Menu

Fix "APNS token has not been set yet" in Flutter on iOS
📰

Fix "APNS token has not been set yet" in Flutter on iOS

DEV Community: dart·Yevhen Beshkarov·5 days ago
#nMMgXNPD
#devtodart#devto#dev#token#firebase
Reading 0:00
15s threshold

On iOS, Firebase delivers push notifications through Apple's push service (APNs), so FirebaseMessaging.instance.getToken() refuses to run until Apple has given the device its APNs token. Called earlier, it throws apns-token-not-set , which older versions of firebase_messaging describe as "APNS token has not been set yet". Usually the app just asked too early. How it should wait depends on the version: firebase_messaging 17 tells the app when Firebase is ready, and 16.7 doesn't. In a few setups, though, Apple never answers, however long the app waits.

I checked everything below on an iPhone 17 simulator with iOS 26.5, Xcode 27.2 and Flutter 3.44.2, with firebase_messaging 16.7.1 (Firebase iOS SDK 12.19.3) and 17.0.1 (Firebase iOS SDK 13.1.1).

APNS token has not been set yet, or has not been received on the device yet

The error comes in two wordings. Older versions say:

[firebase_messaging/apns-token-not-set] APNS token has not been set yet.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.