Q: We started implementing Pushwoosh in our Flutter application, but when we call registerForPushNotifications, we get an exception.
E/Pushwoosh( 1077): [PushRegistrarFCM] FCM registration error: Failed to retrieve token. Is firebase configured correctly?
I/flutter ( 1077): PlatformException(RegisterForPushNotificationsException, , com.pushwoosh.exception.RegisterForPushNotificationsException:
I/flutter ( 1077): at com.pushwoosh.notification.h.a(Unknown Source:13)
I/flutter ( 1077): at com.pushwoosh.notification.j.onReceive(Unknown Source:4)
I/flutter ( 1077): at com.pushwoosh.internal.event.EventBus.b(Unknown Source:23)
I/flutter ( 1077): at com.pushwoosh.internal.event.EventBus.a(Unknown Source:0)
I/flutter ( 1077): at com.pushwoosh.internal.event.c.run(Unknown Source:4)
I/flutter ( 1077): at android.os.Handler.handleCallback(Handler.java:789)
I/flutter ( 1077): at android.os.Handler.dispatchMessage(Handler.java:98)
I/flutter ( 1077): at android.os.Looper.loop(Looper.java:164)
For the implementation I followed the guide and placed the google-services.json file in the android/app folder (Is that really required? Firebase is configured correctly, because our Unity app can receive push notifications just fine. Using latest stable version of Flutter, 1.7.8+hotfix.3.
A: Please check that you have added the following lines to your gradle scripts:
classpath 'com.google.gms:google-services:4.0.1'
to android\build.gradle dependenciesapply plugin: 'com.google.gms.google-services'
to android\app\build.gradle
Also, please double-check that parameters you pass to Pushwoosh.initialize()
are correctly set.
Comments
0 comments
Please sign in to leave a comment.