Local Push Connectivity run example

I'm trying to test local push notification from Receiving Voice and Text Communications on a Local Network example, i already done all steps : installed the App Push Provider entitlement, create the two id app certificat imported them ...

i have the local server launched i can see the following log 2023-05-02 00:31:49.141283+0200 SimplePushServer[51369:1371374] [Debug] Channel Control: Listening on port 5060 2023-05-02 00:31:49.163541+0200 SimplePushServer[51369:1371374] [Debug] Channel Notification: Listening on port 3000 SimplePushServer started. See Console for logs.

i run the SimplePush on a device, i entered the wifi ssid and the simple push server adress with the good port but the active is always no on the screen config

how can i test the local push notification ? can i send a text for example to the server and the application will get it ?

thank you for your help

Replies

I Configured my app to use local push notification, I’m still tried I request for entitlement, I get the approval from apple, I created certificate for both application simplePush and SimplePushProvider With extension network included both certificate are included on a group id

let pushManager = NEAppPushManager() pushManager.matchSSIDs = ["Tenda_6B8340","ouamassi", "Tenda_6B8340_5G", "192.168.1.7"] pushManager.localizedDescription = "PushProvider" pushManager.providerBundleIdentifier = "" // Here I put my id application of the SimplePushProvider I created pushManager.delegate = self pushManager.isEnabled = true pushManager.providerConfiguration = [ "host": "192.168.1.7”. // This is the address ip of my Mac where the server is launched ] pushManager.saveToPreferences(completionHandler: { error in print("error? (error)") print("is active: (pushManager.isActive)") })

My SimplePushProvider is declared like this :

class SimplePushProvider: NEAppPushProvider { private let channel = BaseChannel(port: Port.notification, heartbeatTimeout: .seconds(30), logger: Logger(prependString: "Notification Channel", subsystem: .networking)) private var cancellables = Set<AnyCancellable>() private let logger = Logger(prependString: "SimplePushProvider", subsystem: .general)

….

public override init() {
    super.init()

…. public override func start() { logger.log("Started")

….

The problem is that the SimplePushProvider is never called and pushManager is always no active, I m sure my real device is connected to the ssid included on pushManager.matchSSIDs I tried several ssid but still the same problem

I really stuck with this problem several days any helps will be appreciated

Hi I’m trying to launch the example of local push notification for that I request app push provider entitlement You accept my request of App Push Provider entitlement. But when I select the entitlement when generating provising profile (I select Local Push Provider (Dev)), I can see that in this provising profile I m getting

	&lt;key>com.apple.developer.networking.networkextension&lt;&#x2F;key>
	&lt;array>
		&lt;string>app-push-provider&lt;&#x2F;string>
	&lt;&#x2F;array>

This does not include capabilities <key>com.apple.developer.networking.networkextension</key> <array> <string>app-proxy-provider</string> <string>content-filter-provider</string> <string>dns-proxy</string> <string>dns-settings</string> <string>packet-tunnel-provider</string> </array>

When I select this capabilities in Xcode I’m getting error Provisioning profile "test simple push" doesn't match the entitlements file's value for the com.apple.developer.networking.networkextension entitlement.

I already added networkextensionin application id

If I don’t select capabilities in Xcode and launch the application I’m getting error in Xcode SimplePush[788:64526] [] Failed to load configurations: Error Domain=NEConfigurationErrorDomain Code=10 "permission denied"

And the SimplePushProvider never launched

I’m stuck on this problem for a week please help

Putting this in entitlement is now sufficient

<key>com.apple.developer.networking.networkextension</key> <array> <string>app-push-provider</string> </array>

I don't get any error but still the provider doesn't launch please help