Post

Replies

Boosts

Views

Activity

Reply to Error :- APNS device token not set before retrieving FCM Token for Sender ID '836092823410'. Notifications to this FCM Token will not be delivered over APNS.Be sure to re-retrieve the FCM token once the APNS device token is set.
In my case I'm testing fcm token to firebase with when user sign ins I'm trying to get token to save it on my firestore. So here is my AuthManager func configureAuthStateChanges() { authStateHandle = auth.addStateDidChangeListener { auth, user in if (user != nil) { self.isSigned = true Messaging.messaging().token(){token,error in if let fcmToken = token{ FirestorageManager.shared.saveTokenToFirestore(token: fcmToken) } if let error = error{ print("error ->", error.localizedDescription) } } }else { self.isSigned = false } print("Auth changed: \(user != nil)") self.updateState(user: user) } } When user sign in then I get this error: error -> İşlem tamamlanamadı. No APNS token specified before fetching FCM Token So my solution was in my CustomAppDelegate I add this function and I test it even with empty body I was able to save it on firestore when user sign in Here is function which I added on CustomAppDelegate: func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { }
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’25