Receive notifications from different FCM "senders"

1

I have implemented firebase in a base project and receive respective notifications in the FirebaseMessagingService service, so all right, but then I implement a library that already has firebase but when it sends notifications from your server, if they reach my phone , but it does not enter the FirebaseMessagingService of the library, on the contrary it enters the FirebaseMessagingService of my app. If I remove all FCM from my project and only leave the library implemented if the notifications arrive to their own FirebaseMessagingService. I need the notification according to your "recipient" to reach your respective FirebaseMessagingService.

    
asked by Carlo Renzo 10.03.2017 в 22:54
source

1 answer

-1
  

but does not enter the FirebaseMessagingService of the library, by the   otherwise it enters the FirebaseMessagingService of my app.

Actually the onMessageReceived() method of your class that implements FirebaseMessagingService in your project, is the one that receives the notification,

public class FCMListenerService extends FirebaseMessagingService {

    private static final String TAG = "MyGcmListenerService";

    @Override
    public void onMessageReceived(RemoteMessage message) {
        Log.i(TAG, "Notification received: " + message);
        ...
        ...
    }

}

This must be implemented in your project.

    
answered by 10.03.2017 в 22:59