1

I have a firebase project with two android apps. Both apps have different users.

The dot net based back end sends notification to the apps based on the firebase token synced from devices to server.

My problem is that the first Android app is receiving notifications from the backend, but the second one isn't. Backend uses the same code for both.

Also, both apps are receiving notifications when sent from console.

Some Answers (like this one) suggest to subscribe to a different topic in each app. Is it required, even if the back end is sending notification based on the firebase token of device?

Abdullah
  • 488
  • 6
  • 16
  • If you can send a notification from the Firebase Console to the common topic and both apps are receiving it, then there is a problem with your server. Its quite likely that you server is sending a notification on a different topic. The link you referred to is for targeting specific clients, and hence the subscription to unique topics (irrelevant based on your question). – Puneet Dec 20 '17 at 12:51
  • @Puneet Thanks for your prompt response. But the server is not sending the notification on any topic, instead it is sending it on the 'fcm registration token' of device. From console also, the target I chose was 'Single Device'. – Abdullah Dec 20 '17 at 12:56
  • check method where we get notification in android and try to print it if data comes in both cases problem is with android else backend – Shivam Oberoi Dec 20 '17 at 12:57
  • 1
    This still seems like a backend problem because notification are being received by the app when sent from the Firebase console but not when sent from the server (for one client). Without having access to the backend code, its difficult to say. Consider logging the client Firebase tokens on the server when it sends a notification. My guess is something is going wrong there. – Puneet Dec 20 '17 at 13:03
  • @ShivamOberoi Thanks, but I want to know if it is necessary to target by **'Topic'** instead of **'Single Device'**, if there are two or more apps in a project? – Abdullah Dec 20 '17 at 13:05
  • NO its not necessary. btw,are you using firebase for push notifications. – Shivam Oberoi Dec 21 '17 at 05:44
  • Thanks @ShivamOberoi, yes I am using Firebase for push notifications. – Abdullah Dec 21 '17 at 06:19
  • no its not necessary to subsribe to channel or topic just print on message recieve method wheather notification is coming or not – Shivam Oberoi Dec 21 '17 at 06:20

0 Answers0