bazelbuild/rules_apple

How should I build a Network Extension about Xcode

huangzqh opened this issue · 4 comments

How should I build a Network Extension for iOS App?

Can you be more specific?

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

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 = [

],
)`

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 = [

],
)`