flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

[firebase_messaging]: <Flutter ios device getToken getting unknown error>

Open Amina-UC-Dev opened this issue 2 months ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues.

Which plugins are affected?

Messaging

Which platforms are affected?

iOS

Description

for the device token im calling FirebaseMessaging.instance.getToken() but im getting error like this on ios platform [firebase_messaging/unknown] An unknown error has occurred.

this actually happend from december 5th onwards, it was working fine but suddenly this happend.

Reproducing the issue

same way getToken calling you will get the error

Firebase Core version

4.2.1

Flutter Version

3.35.3

Relevant Log Output


Flutter dependencies

Expand Flutter dependencies snippet

Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

Amina-UC-Dev avatar Dec 08 '25 05:12 Amina-UC-Dev

Hi @Amina-UC-Dev, I'm unable to reproduce this with the firebase_messaging example app. The token is received without errors. Could you run our example app to see if the issue still persist?

SelaseKay avatar Dec 10 '25 08:12 SelaseKay

I also encountered the same issue. After replacing AppDelegate with SceneDelegate in my iOS project, I am no longer able to obtain the token, although it worked correctly before the replacement. Currently, the workaround is to add application.registerForRemoteNotifications() in didFinishLaunchingWithOptions, but I’m not sure what other issues this might cause. @SelaseKay @Amina-UC-Dev

a632561869-cloud avatar Dec 15 '25 03:12 a632561869-cloud