React Native Android Push Registration Failed

Originally posted this in the topic for other platforms but as that topic seems a little unmaintained and as this issue is probably just a misconfiguration from my side, I decided to post this issue here again.

Neither in our app nor in the react-native sample app (https://github.com/urbanairship/react-native-module/tree/master/sample) I get push notifications to work on Android.

Both apps compile and launch but instantly after the launch I get the error that the push registration failed which reoccurs unregulary afterwards.

The app key for our own app is y-kEswr4SZKB5CtVO2ec8g, the key of the Sample app is WhwPGXUEQ6aSxKstppE7nQ. I checked the airshipconfig.properties where I inserted the app key/app secret-combination for development- and production-version and also the gcm sender id. I also checked the api-key for android in the UA-dashboard and tried both the api_key from the downloaded google-services.json file and the server key from the firebase project settings -> cloud messaging tab (error occurs in both cases). Did I maybe miss a step in the firebase project creation? I only created the project and downloaded the google-services.json but skipped the firebase sdk integration as I assume that this comes with the Urban Airship RN-sdk, right?

The 1st flight app works.

The error looks as follows:

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: Push registration failed.

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: com.urbanairship.push.PushProvider$RegistrationException: GCM registration failed.

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.urbanairship.push.gcm.GcmPushProvider.getRegistrationToken(GcmPushProvider.java:55)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.urbanairship.push.PushManagerJobHandler.onUpdatePushRegistration(PushManagerJobHandler.java:178)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.urbanairship.push.PushManagerJobHandler.performJob(PushManagerJobHandler.java:118)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.urbanairship.push.PushManager.onPerformJob(PushManager.java:402)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.urbanairship.job.Job$1.run(Job.java:91)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at java.lang.Thread.run(Thread.java:818)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: Caused by: java.io.IOException: INVALID_SENDER

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.google.android.gms.iid.zzaf.zzi(Unknown Source)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.google.android.gms.iid.InstanceID.zze(Unknown Source)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.google.android.gms.iid.InstanceID.getToken(Unknown Source)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: at com.urbanairship.push.gcm.GcmPushProvider.getRegistrationToken(GcmPushProvider.java:47)

05-09 13:48:11.471 24290 24849 E AirshipSample - UALib: ... 7 more

happened on urbanairship-react-native 1.6.2

Help would be really appreciated :)

Didn't find what you were looking for?

New post

Comments

2 comments

  • Hi Raoul,

    Thank you for writing in to the Urban Airship Support Forum about your issues with push registration on Android.

    As a first pass at troubleshooting this, here are a couple of things to try:

    1. Remove the google-services.json file from your project. This file is only necessary for v. 9.1.+ of our Android SDK. The latest version of the React Native module does not link to this version, so the file is not needed.
    2. The errors seem to be related to an invalid sender ID. I know you've said you already checked your configuration, but it might be a good idea to walk through our guide on FCM/GCM Troubleshooting just to see if any of the suggestions there resolve the errors.

    Please let me know if you're still seeing errors after trying my suggestions above and I'll investigate this further.

    Comment actions Permalink
    0
  • Have you ensured that Firebase Cloud Messaging (FCM) is properly set up Super Foam Usa and configured for your React Native app, including the necessary permissions and configurations in the android/app/src/main/AndroidManifest.xml file?

    Comment actions Permalink
    0

Please sign in to leave a comment.