Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the "old" GCM listener to get compatibility with GCM back #835

Merged
merged 1 commit into from
Sep 6, 2018

Conversation

Gp2mv3
Copy link
Contributor

@Gp2mv3 Gp2mv3 commented Aug 21, 2018

Maybe not the best solution in term of code redundancy but it works.
What do you think ?

@silentlight
Copy link

@Gp2mv3 When I install version 3.1.1 through npm or yarn RNPushNotificationListenerServiceGcm does not exist, however I see it in the repo on master branch. Should bumping the version solve the problem?

@silentlight
Copy link

Hi @Gp2mv3. Any insights on my above question?

@stpch
Copy link

stpch commented Sep 19, 2018

It still crashes for me when receiving a GCM push notification. I'm using the latest commit containing this PR (yarn add https://github.com/zo0r/react-native-push-notification#aaf2d19925db4666d6018c0ab1ff0d7d4c90a21d).

@msadura
Copy link

msadura commented Sep 20, 2018

@silentlight 3.1.1 is a tag, not the latest master. You need to point package.json to latest master commit manually so replace:
"react-native-push-notification": "3.1.1" (3.1.1 tag)

with:
"react-native-push-notification": "git+https://github.com/zo0r/react-native-push-notification.git#aaf2d19925db4666d6018c0ab1ff0d7d4c90a21d" (aaf2d19925db4666d6018c0ab1ff0d7d4c90a21d is the lates commit atm)

& yarn install :)

@JasonTolliver
Copy link

I'm with @stpch, I'm still crashing when receiving notifications while app is in the foreground. Have this branch checked out even:

"react-native-push-notification": "https://github.com/zo0r/react-native-push-notification.git#fixGcm",

E/AndroidRuntime: FATAL EXCEPTION: Firebase-FirebaseMessagingService
                  Process: com.rewardshub, PID: 21666
                  java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.rewardshub. Make sure to call FirebaseApp.initializeApp(Context) first.
                      at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@16.0.1:219)
                      at com.google.firebase.messaging.MessagingAnalytics.zza(Unknown Source)
                      at com.google.firebase.messaging.MessagingAnalytics.logNotificationReceived(Unknown Source)
                      at com.google.firebase.messaging.FirebaseMessagingService.zzd(Unknown Source)
                      at com.google.firebase.iid.zzc.run(Unknown Source)
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                      at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source)
                      at java.lang.Thread.run(Thread.java:818)

@JasonTolliver
Copy link

JasonTolliver commented Sep 22, 2018

It would appear that the firebase and GCM dependencies in build.gradle cannot coexist:

compile "com.google.android.gms:play-services-gcm:$googlePlayServicesVersion"
compile "com.google.firebase:firebase-messaging:$firebaseVersion"

after deleting the firebase entry and any classes that depend on it I was able to rebuild and no more crashes.

Looks like forking and reverting #717 is the only option to support GCM.

Note: GCM is 100% deprecated, only do this if you know what you're doing and why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants