hansemannn / titanium-firebase-cloud-messaging

Use the Firebase Cloud Messaging SDK in Axway Titanium 🚀 Edit
Other
43 stars 31 forks source link

fix(android): fix crash on first app launch, update firebase-messaging to 20.1.6 #109

Closed hansemannn closed 4 years ago

hansemannn commented 4 years ago

Fixes an issue where the app crashes on the first launch after the install by performing proper null-checks on the instance instead of forcing to re-instantiate the module.

Also bumps the version of firebase-messaging to 20.1.6.

firebase.cloudmessaging-android-3.0.1.zip

hansemannn commented 4 years ago

It seems like notifications not arrive right now. Shiet!

m1ga commented 4 years ago

@hansemannn try lowering "com.google.firebase:firebase-messaging" again. Tried alot of combinations and not all worked

hansemannn commented 4 years ago

Do you really think it's the version? I rather think it's the instance not working properly anymore, since I don't re-initiate it and it may not pass the null-check.

hansemannn commented 4 years ago

All working now!

hansemannn commented 4 years ago

@m1ga Thank you! Can you test the fresh install as well? It should not crash

m1ga commented 4 years ago

sure. Made a playstore version and installed it with adb install. No crash after starting the app. Got a token right away (without using configure())

hansemannn commented 4 years ago

Alright!

fahad86 commented 4 years ago

@hansemannn try lowering "com.google.firebase:firebase-messaging" again. Tried alot of combinations and not all worked

You may try this with the latest version:

"setting for gcm_defaultSenderId was missing, adding this, resolved the issue. So in total my app needed the following 3 options set to run: gcm_defaultSenderId, google_api_key, google_app_id. I leave it to you to figure the corresponding setter, as I have these values in values\strings.xml."

https://stackoverflow.com/questions/48828087/firebase-analytics-failed-to-retrieve-firebase-instance-id