react-native-fcm icon indicating copy to clipboard operation
react-native-fcm copied to clipboard

subscribeToTopic not Working

Open tarikhagustia opened this issue 9 years ago • 5 comments

i have try this command FCM.subscribeToTopic('/topics/food'); or FCM.subscribeToTopic('news'); but in firebase console the list of topic not show, any idea to check subscribe working or Not ?

tarikhagustia avatar May 23 '17 07:05 tarikhagustia

I just did a few tests and yes it is working. It can take up to 24 hrs to show up in Firebase Console, mine took almost 1 hr to appear. (refer to https://stackoverflow.com/a/37376040)

cmedinasoriano1 avatar Jun 04 '17 00:06 cmedinasoriano1

what the return of function ? i got null , thx

tarikhagustia avatar Jun 04 '17 07:06 tarikhagustia

That is correct, it is null. If you look at the function signature in react-native-fcm/index.js you will see that it is not supposed to return anything.

When you are at firebase's console, make sure you at least type the first character of your topic, because it does NOT automatically search for available topics just by selecting the box, to see if it is already available.

Also, looking at the second command you first posted, as I understand, when using the subscribe function, it is supposed to be FCM.subscribeToTopic('/topics/news'); instead of FCM.subscribeToTopic('news');

cmedinasoriano1 avatar Jun 04 '17 08:06 cmedinasoriano1

oke works fine, take 2 days to appears on console, 👍 thanks

tarikhagustia avatar Jun 05 '17 04:06 tarikhagustia

Great! Shouldn't you close this issue?

cmedinasoriano1 avatar Jun 05 '17 12:06 cmedinasoriano1