Comment gérer firebase notification sur fond ainsi que du premier plan?

Je veux poignée de firebase message de notification sur l'immigration ainsi que sur le premier plan . Je vais envoyer un message qui sera composé d'un lien youtube du réalisateur et lorsque l'utilisateur appuyez sur la barre de notification, elle doit adresser à l'utilisateur d'ouvrir le lien. Personne ne sait comment c'est fait?

 public void onMessageReceived(RemoteMessage remoteMessage) {
    //[START_EXCLUDE]
    //There are two types of messages data messages and notification messages. Data messages are handled
    //here in onMessageReceived whether the app is in the foreground or background. Data messages are the type
    //traditionally used with GCM. Notification messages are only received here in onMessageReceived when the app
    //is in the foreground. When the app is in the background an automatically generated notification is displayed.
    //When the user taps on the notification they are returned to the app. Messages containing both notification
    //and data payloads are treated as notification messages. The Firebase console always sends notification

    //[END_EXCLUDE]

    //TODO(developer): Handle FCM messages here.
    //Not getting messages here? See why this may be:
    Log.d(TAG, "From: " + remoteMessage.getFrom());

    //Check if message contains a data payload.
    if (remoteMessage.getData().size() > 0) {
        Log.d(TAG, "Message data payload: " + remoteMessage.getData());
    }

    //Check if message contains a notification payload.
    if (remoteMessage.getNotification() != null) {
        Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
    }

    //Also if you intend on generating your own notifications as a result of a received FCM
    //message, here is where that should be initiated. See sendNotification method below.
}

quoi faire pour atteindre mon objectif? Merci d'avance:)

Le code affiché est juste l'un des échantillons. Donc je suis en supposant que vous avez traversé. Y avait-il quelque chose de confus à ce sujet? Avez-vous également passé par les docs? Maintenant, c'est juste comme un me donner le code question.
Essayer Ma solution?<br> j'ai déjà essayé.<br>, Et il fonctionne<br> stackoverflow.com/questions/48897883/...

OriginalL'auteur vishal gupta | 2017-03-16