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

Could not invoke RNFIRMessaging.SubscribeToTopic #976

Open
ergxpr0xy opened this issue Jun 11, 2018 · 15 comments
Open

Could not invoke RNFIRMessaging.SubscribeToTopic #976

ergxpr0xy opened this issue Jun 11, 2018 · 15 comments

Comments

@ergxpr0xy
Copy link

ergxpr0xy commented Jun 11, 2018

App.js

import FCM from 'react-native-fcm'

componentDidMount() {
...
FCM.subscribeToTopic('/topics/feeds');
}

screenshot 318

"react-native": "^0.55.4",
"react-native-fcm": "^10.0.3",
Android Emulator 6
running in foreground

thanks in advance

@alexus37
Copy link

I have the same issue

@evollu
Copy link
Owner

evollu commented Jun 13, 2018

looks like this line is broken, saying the method not existing.
https://github.com/evollu/react-native-fcm/blob/master/android/src/main/java/com/evollu/react/fcm/FIRMessagingModule.java#L206

what version of firebase are you using?

@coderwassananmol
Copy link
Contributor

I am using firebase-messaging:17.0.0 and face the same issue while calling the above method.

@rafameyer
Copy link

I have the same issues, is it a version problem about firebase ?

@tiendn
Copy link

tiendn commented Jul 20, 2018

I have the same issues

     "react-native-fcm": "^16.0.0",
     "react-native": "0.49.5",
     "react-native-firebase": "^4.1.0",
    implementation ('com.google.android.gms:play-services-gcm:15.0.1') {
      force = true;
    }
    implementation 'com.google.android.gms:play-services-auth:15.0.1' // should be at least 9.0.0
    implementation(project(':react-native-firebase')) {
        transitive = false
    }
    implementation "com.google.android.gms:play-services-base:15.0.1"
    // Firebase dependencies
    implementation "com.google.firebase:firebase-firestore:17.0.2"
    implementation "com.google.firebase:firebase-storage:15.0.2"
    implementation "com.google.firebase:firebase-core:16.0.1"
    implementation "com.google.firebase:firebase-auth:16.0.2"
    implementation "com.google.firebase:firebase-messaging:17.1.0"

@KennethLoOctopuspos
Copy link

downgrade firebase-messaging to 15.0.2 seems to be a temporary fix for me now:

compile "com.google.firebase:firebase-messaging:15.0.2"

@ZahiC
Copy link

ZahiC commented Aug 6, 2018

hey @KennethLoOctopuspos , I tried to temporary fix the issue with changing firebase-messaging version to 15.0.2. It doesn't work for me.
Any chance you post here all the google/firebase dependency versions?
And what version of react-native-fcm do you use?

@KennethLoOctopuspos
Copy link

Hi @ZahiC I'm using react-native-fcm 16.0.0 with these dependency settings:

compile "com.google.firebase:firebase-messaging:15.0.2"
compile "com.google.firebase:firebase-core:15.0.2"
compile "com.google.android.gms:play-services-gcm:15.0.1"

@dhcmega
Copy link

dhcmega commented Dec 7, 2018

Hi, any fix for this?

@tiendn
Copy link

tiendn commented Dec 7, 2018

@dhcmega
I think you should move to react-native-firebase

react-native-firebase has introduced new firebase messaging and remote/local notification features. It has good integration with other firebase features. I would recommend new comers to check that.

@coderwassananmol
Copy link
Contributor

You just have to get the right versions of the dependencies. I experienced some struggle but finally manged to get everything working using the below versions:
"react-native-fcm" : "https://github.com/coderwassananmol/react-native-fcm#sdk-26"
com.android.tools.build:gradle:3.1.4
com.google.gms:google-services:3.2.0
com.google.firebase:firebase-core:16.0.4
com.google.firebase:firebase-messaging:17.3.4

Hope it helps!

@dhcmega
Copy link

dhcmega commented Dec 7, 2018

@tiendn, I will try to solve it, if not, I will consider moving. Thanks!
@coderwassananmol, I have tried but still same error, what about the other packages, are they related?

    implementation 'com.google.android.gms:play-services-base:16.0.0'

    implementation ("com.google.android.gms:play-services-gcm:16.0.0") {
        force = true;
    }

Thanks!

@coderwassananmol
Copy link
Contributor

@tiendn, I will try to solve it, if not, I will consider moving. Thanks!
@coderwassananmol, I have tried but still same error, what about the other packages, are they related?

    implementation 'com.google.android.gms:play-services-base:16.0.0'

    implementation ("com.google.android.gms:play-services-gcm:16.0.0") {
        force = true;
    }

Thanks!

@dhcmega Why are you still including gcm? It's deprecated and makes no sense in using it. Instead you should be using firebase-messaging:17.3.4. Apart from that, answering your question, I'm using one more dependency with this project, i.e, com.google.android.gms:play-services-auth:16.0.1.

@dhcmega
Copy link

dhcmega commented Dec 7, 2018

@coderwassananmol, I have deleted gcm, thanks.
Still not working, but at least I'm using more updated packages.
Will post if I ever make it work.
Thanks.

@dhcmega
Copy link

dhcmega commented Dec 12, 2018

It seems that I'm having a version conflict.
I have solved it by modifying the package, not the best solution but at least I can publish the app:

https://stackoverflow.com/questions/50592049/how-can-i-resolve-the-nosuchmethoderror-caused-by-firebase-subscribetotopic

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

No branches or pull requests

9 participants