title: Target Screen not open when app is not running Firebase Notification FCM?
body: <p>The problem is that When the App is running then notification is working fine (notification goes to targeted screen ) However tha app state is onPause or closwd then notification on click not open the targeted screen How i can solve it  here is my code ---&gt;</p>
  <pre><code>public class MyFirebaseMessagingService extends FirebaseMessagingService {
  
  public static final String NOTIFICATION_CHANNEL_ID = &quot;Sesame&quot; ;
  private  static final   String NOTIFICATION_NAME= &quot;Sesame&quot;;
  private static int count = 0;
  private static final String TAG = MyFirebaseMessagingService.class.getName();
  
  @Override
  public void onMessageReceived(RemoteMessage message) {
      super.onMessageReceived(message);
  
      Map&lt;String, String&gt; data = message.getData();
  
      String title = data.get(&quot;title&quot;);
      String msg = data.get(&quot;message&quot;);
      String deepLink = data.get(&quot;deepLink&quot;);
      String slug = data.get(&quot;slug&quot;);
  
  sendMyNotification(title,msg,deepLink,message);
  
  
  }
  
  private void sendMyNotification(String message, String body, String deeplink, RemoteMessage remoteMessage) {
  
   Intent intent = new Intent(this,MainActivity.class);
      if (remoteMessage.getData().size() &gt;0){
          if (deeplink.equals(&quot;deepLink&quot;)){
              intent = new Intent(this, TermsConditionsActivity.class);
              intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
              Log.i(TAG, &quot;sendMyNotification: Terms &quot;);
          }}
  
  
   intent.setPackage(null);
      intent.addFlags(Intent.FLAG_FROM_BACKGROUND | Intent.FLAG_RECEIVER_NO_ABORT);
      PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
              PendingIntent.FLAG_UPDATE_CURRENT |
              PendingIntent.FLAG_ONE_SHOT |
              PendingIntent.FLAG_IMMUTABLE);
  
  Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
      NotificationManager mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  
  
   if (android.os.Build.VERSION.SDK_INT &gt;= android.os.Build.VERSION_CODES.O) {
          int importance = NotificationManager.IMPORTANCE_HIGH;
          NotificationChannel mChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID,NOTIFICATION_NAME, importance);
          mChannel.setDescription(message);
          mChannel.enableLights(true);
          mChannel.setLightColor(Color.RED);
          mChannel.enableVibration(true);
          mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
  
          mNotifyManager.createNotificationChannel(mChannel);
      }
  
  
  NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this, NOTIFICATION_NAME);
      mBuilder.setContentTitle(message)
              .setContentText(body)
              .setSmallIcon(R.mipmap.ic_launcher)
              .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher))
              .setAutoCancel(true)
              .setSound(defaultSoundUri)
              .setColor(Color.parseColor(&quot;#FFD600&quot;))
              .setContentIntent(pendingIntent)
              .setChannelId(NOTIFICATION_CHANNEL_ID)
              .setVibrate(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400})
              .setPriority(NotificationCompat.PRIORITY_HIGH);
  
      mNotifyManager.notify(count, mBuilder.build());
      count++;}}
  </code></pre>
  <p><strong>In my Manifest.xml file --&gt;</strong></p>
  <pre><code>    &lt;service android:name=&quot;.notifications.MyFirebaseMessagingService&quot;
          android:exported=&quot;false&quot;&gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;com.google.firebase.MESSAGING_EVENT&quot; /&gt;
          &lt;/intent-filter&gt;
          &lt;meta-data
              android:name=&quot;com.google.firebase.messaging.default_notification_color&quot;
              android:resource=&quot;@color/colorAccent&quot; /&gt;
      &lt;/service&gt;
  </code></pre>
  <p>And Target Activity as -&gt;</p>
  <pre><code>  &lt;activity android:name=&quot;.activities.TermsConditionsActivity&quot; &gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;deepLink&quot;&gt;&lt;/action&gt;
              &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;&gt;&lt;/category&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  <p>And in my Target Activity i subscribe the topic</p>
  <pre><code>   FirebaseMessaging.getInstance().subscribeToTopic(&quot;topic&quot;);
  </code></pre>
  <p>Please help me..</p>