Contents

NEAppPushProvider

An object that creates and maintains a persistent network connection to a local push server.

Declaration

class NEAppPushProvider

Mentioned in

Overview

Subclass NEAppPushProvider to provide the connection to your local push server. A NEAppPushManager creates instances of your provider class based on the providerBundleIdentifier in the manager’s configuration. The manager then calls methods on your provider to start and stop communication with the server, and periodically check the provider’s status. When your provider receives an incoming call from your server, call the provider’s reportIncomingCall(userInfo:) method to alert the manager’s delegate.

Creating a Local Push Provider Extension

Local Push Providers run as App Extensions for the app-push-provider extension point, which is a possible value the Network Extensions Entitlement.

To create a Local Push Provider extension, first create a new App Extension target in your project.

For an example of an Xcode build target for this app extension, see the Receiving Voice and Text Communications on a Local Network sample code project.

Once you have an extension target, create a subclass of NEAppPushProvider. Then set the NSExtensionPrincipalClass key in the extension’s Info.plist to the name of your subclass. Set the NSExtensionPointIdentifier key in the extension’s Info.plist to com.apple.networkextension.app-push, if it’s not set already.

Here’s an example of the NSExtension dictionary in a Local Push Provider extension’s Info.plist:

<key>NSExtension</key>
<dict>
    <key>NSExtensionPointIdentifier</key>
    <string>com.apple.networkextension.app-push</string>
    <key>NSExtensionPrincipalClass</key>
    <string>$(PRODUCT_MODULE_NAME).MyPushProvider</string>
</dict>

Finally, add your Local Push Provider extension target to your app’s Embed App Extensions build phase.

Topics

Inspecting provider properties

Implementing provider life cycle

Receiving local events

Operating over Ethernet

See Also

Essentials