Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I build a Network Extension about Xcode #2448

Open
huangzqh opened this issue Apr 17, 2024 · 4 comments
Open

How should I build a Network Extension about Xcode #2448

huangzqh opened this issue Apr 17, 2024 · 4 comments

Comments

@huangzqh
Copy link

How should I build a Network Extension for iOS App?

@luispadron
Copy link
Contributor

Can you be more specific?

@keith
Copy link
Member

keith commented Apr 17, 2024

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

@huangzqh
Copy link
Author

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
Copy link
Author

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

],
)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants