Enable Remote Push

This commit is contained in:
Benoit Martins 2024-05-13 11:40:15 +02:00
parent 965ae0e35a
commit b46c2ef778

View file

@ -29,8 +29,8 @@ class AppDelegate: NSObject, UIApplicationDelegate {
Log.info("Received remote push token : \(tokenStr)")
CoreContext.shared.doOnCoreQueue { core in
Log.warn("Push are disabled for this version, do not forward push token to the core")
//Log.info("Forwarding remote push token to core")
//core.didRegisterForRemotePushWithStringifiedToken(deviceTokenStr: tokenStr + ":remote")
Log.info("Forwarding remote push token to core")
core.didRegisterForRemotePushWithStringifiedToken(deviceTokenStr: tokenStr + ":remote")
}
}
@ -40,12 +40,11 @@ class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
Log.info("Received background push notification, payload = \(userInfo.description)")
/*
let creationToken = (userInfo["customPayload"] as? NSDictionary)?["token"] as? String
if let creationToken = creationToken {
NotificationCenter.default.post(name: accountTokenNotification, object: nil, userInfo: ["token": creationToken])
}
completionHandler(UIBackgroundFetchResult.newData)*/
completionHandler(UIBackgroundFetchResult.newData)
}
func applicationWillTerminate(_ application: UIApplication) {