title: Deep Link with Push Notification - FCM - Android
body: <p><strong>What I want:</strong> I want to send push notification to users. When user tap on that notification, user should navigate to specific activity.</p>
  
  <p><strong>What I did:</strong> I created one deep link in Firebase console. I implemented <strong>FirebaseInstanceIdService</strong> &amp; <strong>FirebaseMessagingService</strong> as well. I'm able to catch Firebase message which I sent from Firebase console.</p>
  
  <p><strong>What is the issue:</strong> I'm not able to catch the dynamic link what I have created in Firebase console.</p>
  
  <p>My code is like below.</p>
  
  <p><strong>MyFirebaseInstanceIDService.java</strong></p>
  
  <pre><code>    public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService {
  
      private final String TAG = "MyFirebaseInstanceID";
  
      @Override
      public void onTokenRefresh() {
  
          String refreshedToken = FirebaseInstanceId.getInstance().getToken();
  
          Log.e(TAG, "Refreshed token: " + refreshedToken);
      }
  }
  </code></pre>
  
  <p><strong>MyFirebaseMessagingService.java</strong></p>
  
  <pre><code>    public class MyFirebaseMessagingService extends FirebaseMessagingService {
  
      private final String TAG = "MyFbaseMessagingService";
  
      @Override
      public void onMessageReceived(RemoteMessage remoteMessage) {
  
          String message = remoteMessage.getNotification().getBody();
  
          Log.e(TAG, "\nmessage: " + message);
  
          sendNotification(message);
      }
  
      private void sendNotification(String message) {
  
          Intent intent = new Intent(this, TestDeepLinkActivity.class);
          intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  
          Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
  
          PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
  
          NotificationCompat.Builder builder = new NotificationCompat.Builder(this)
                  .setAutoCancel(true)
                  .setContentTitle("FCM Test")
                  .setContentText(message)
                  .setSound(defaultSoundUri)
                  .setSmallIcon(R.drawable.common_google_signin_btn_icon_dark)
                  .setContentIntent(pendingIntent);
  
          NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  
          manager.notify(0, builder.build());
      }
  }
  </code></pre>
  
  <p><strong>Firebase Console Image</strong></p>
  
  <p><a href="https://i.stack.imgur.com/trqRp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/trqRp.png" alt="Firebase Console Image"></a></p>