Before encountering the error, I was using Xcode which had Firebase installed. At around 12pm today, I began encountering an error that looked like this
APNS device token not set before retrieving FCM Token for Sender ID 'XXXXXXXXX'.Be sure to re-retrieve the FCM token once the APNS device token is set.
Prior to 12pm, I did not encounter the error at all
After tinkering with it for 9 hours, I tried moving methods around, looked up many websites to find the exact error, debugging, and even went to YouTube of all places, but can't figure out where the error is coming from.
If it helps, I am currently using Xcode 16 with Firebase version 10.27.
Here's the code for anyone who thinks they can find the answer
This is in my AppDelegate from constant debugging
For extra context:
I have the app running on my iPhone 15 Pro Max and was running well before the error
I have Background Modes enabled (Background fetch, processing, remote notifications)
In my Firebase Console, I have the APN key in my Cloud Messaging section
I have added the app to my Firebase server
I have the Google Info.plist in my code
I have the app registred for App Attest (AppCheck) and DeviceCheck
Before encountering the error, I was using Xcode which had Firebase installed. At around 12pm today, I began encountering an error that looked like this
APNS device token not set before retrieving FCM Token for Sender ID 'XXXXXXXXX'.Be sure to re-retrieve the FCM token once the APNS device token is set.
Prior to 12pm, I did not encounter the error at all
After tinkering with it for 9 hours, I tried moving methods around, looked up many websites to find the exact error, debugging, and even went to YouTube of all places, but can't figure out where the error is coming from.
If it helps, I am currently using Xcode 16 with Firebase version 10.27.
Here's the code for anyone who thinks they can find the answer
This is in my AppDelegate from constant debugging
For extra context:
I have the app running on my iPhone 15 Pro Max and was running well before the error I have Background Modes enabled (Background fetch, processing, remote notifications) In my Firebase Console, I have the APN key in my Cloud Messaging section I have added the app to my Firebase server I have the Google Info.plist in my code I have the app registred for App Attest (AppCheck) and DeviceCheck
`import UIKit import UserNotifications import Firebase import FirebaseMessaging import TabularData import FirebaseInAppMessaging
class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate, MessagingDelegate {
}
@MainActor class NotificationManager: ObservableObject{ @Published private(set) var hasPermission = false static let shared = NotificationManager()
}
extension Notification.Name { static let newPickupRequest = Notification.Name("newPickupRequest") }
@MainActor class NotificationHandler: NSObject, ObservableObject { @Published var newRequestAlert = false
}
class NotificationDelegate: NSObject, UNUserNotificationCenterDelegate {
} `