Reputation: 2057
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'm getting no error when saving NEAppPushManager
I really stuck with this problem several days any helps will be appreciated
Upvotes: 0
Views: 508
Reputation: 1
I'm also trying to implement Local Push and had the same problems as you.
I was able to get past the problems by following: https://developer.apple.com/forums/thread/705382
Got some logs that got me to understand the problem by using "Console.app" (just run "Console" on your Mac).
Upvotes: 0