diff options
author | Isidro Henoch <imhenoch@protonmail.com> | 2022-02-19 13:57:27 -0600 |
---|---|---|
committer | Isidro Henoch <imhenoch@protonmail.com> | 2022-02-19 13:57:27 -0600 |
commit | e0861bf29a6688195019cd74c6f81c61a24ff0a5 (patch) | |
tree | 4886c39f8f95e01f8819986d2989db55e6c22d3c /iosApp | |
parent | bf3436368992746e306c8bd492b70e136ff70f45 (diff) | |
download | etbsa-trackermap-mobile-e0861bf29a6688195019cd74c6f81c61a24ff0a5.tar.gz etbsa-trackermap-mobile-e0861bf29a6688195019cd74c6f81c61a24ff0a5.tar.bz2 etbsa-trackermap-mobile-e0861bf29a6688195019cd74c6f81c61a24ff0a5.zip |
Register the APNs token to receive fcm notifications
Diffstat (limited to 'iosApp')
-rw-r--r-- | iosApp/iosApp/AppDelegate.swift | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/iosApp/iosApp/AppDelegate.swift b/iosApp/iosApp/AppDelegate.swift index 4233910..72e3e92 100644 --- a/iosApp/iosApp/AppDelegate.swift +++ b/iosApp/iosApp/AppDelegate.swift @@ -39,6 +39,14 @@ class AppDelegate: NSObject, UIApplicationDelegate { print(userInfo) return UIBackgroundFetchResult.newData } + + func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { + #if DEBUG + Messaging.messaging().setAPNSToken(deviceToken, type: .sandbox) + #else + Messaging.messaging().setAPNSToken(deviceToken, type: .prod) + #endif + } } extension AppDelegate: UNUserNotificationCenterDelegate { |