rules_apple icon indicating copy to clipboard operation
rules_apple copied to clipboard

How should I build a Network Extension about Xcode

Open huangzqh opened this issue 1 year ago • 4 comments

How should I build a Network Extension for iOS App?

huangzqh avatar Apr 17 '24 13:04 huangzqh

Can you be more specific?

luispadron avatar Apr 17 '24 15:04 luispadron

you probably want a ios_extension target, and then the details that make it a network extension specifically normally come from the Info.plist of that target, which is up to you to provide. The easiest way is probably to create a new network extension target in Xcode and copy the plist from there

keith avatar Apr 17 '24 15:04 keith

you probably want a ios_extension target, and then the details that make it a network extension specifically normally come from the Info.plist of that target, which is up to you to provide. The easiest way is probably to create a new network extension target in Xcode and copy the plist from there

I want to add a Network Extension to my app, but I don't seem to be generating Targets successfully. Here is my configuration: `plist_fragment( name = "VPNTunnelInfoPlist", extension = "plist", template = """ CFBundleDevelopmentRegion en CFBundleIdentifier {bundle_id}.VPNTunnel CFBundleName Telegram CFBundlePackageType XPC! NSExtension

NSExtensionPointIdentifier com.apple.networkextension.packet-tunnel NSExtensionPrincipalClass PacketTunnelProvider

""".format( bundle_id = bundle_id, ) )

ios_extension( name = "VPNTunnelExtension", bundle_id = "{bundle_id}.VPNTunnel".format( bundle_id = bundle_id, ), families = [ "iphone", "ipad", ], infoplists = [ ":VPNTunnelInfoPlist", ":VersionInfoPlist", ":RequiredDeviceCapabilitiesPlist", ":BuildNumberInfoPlist", ":AppNameInfoPlist", ], minimum_os_version = minimum_os_version, entitlements = ":VPNTunnel.entitlements", frameworks = [

], )`

huangzqh avatar Apr 18 '24 08:04 huangzqh

Can you be more specific?

I want to add a Network Extension to my app, but I don't seem to be generating Targets successfully. Here is my configuration: `plist_fragment( name = "VPNTunnelInfoPlist", extension = "plist", template = """ CFBundleDevelopmentRegion en CFBundleIdentifier {bundle_id}.VPNTunnel CFBundleName Telegram CFBundlePackageType XPC! NSExtension

NSExtensionPointIdentifier com.apple.networkextension.packet-tunnel NSExtensionPrincipalClass PacketTunnelProvider

""".format( bundle_id = bundle_id, ) )

ios_extension( name = "VPNTunnelExtension", bundle_id = "{bundle_id}.VPNTunnel".format( bundle_id = bundle_id, ), families = [ "iphone", "ipad", ], infoplists = [ ":VPNTunnelInfoPlist", ":VersionInfoPlist", ":RequiredDeviceCapabilitiesPlist", ":BuildNumberInfoPlist", ":AppNameInfoPlist", ], minimum_os_version = minimum_os_version, entitlements = ":VPNTunnel.entitlements", frameworks = [

], )`

huangzqh avatar Apr 18 '24 12:04 huangzqh