title: Get extras from notifcation - FCM
body: <p>I'm trying to get extra from bundle when I open the app when click on notification. </p>
  
  <p>I have this method on MainActivity:</p>
  
  <pre><code>    private void getBundleFromFirebaseMessaging(){
      Intent intent = this.getIntent();
      if (intent != null &amp;&amp; intent.getExtras() != null) {
          Bundle b = getIntent().getExtras();
          boolean cameFromNotification = b.getBoolean("fromNotification");
          if (cameFromNotification) {
              Toast.makeText(this, "FROM PUSH", Toast.LENGTH_SHORT).show();
          }
      }
  </code></pre>
  
  <p>The only bundle I get is the _fbSourceApplicationHasBeenSet.</p>
  
  <p>This is my method on my FirebaseMessaging class</p>
  
  <pre><code>    private fun sendNotification(message: RemoteMessage) {
      val messageBody = message.notification?.body
      val intent = Intent(this, MainActivity::class.java)
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
      intent.putExtra("fromNotification", true)
      val pendingIntent = PendingIntent.getActivity(this,
              0 /* Request code */, intent,
              PendingIntent.FLAG_ONE_SHOT)
  
      val channelId = getString(R.string.notification_channel)
      val channelName = getString(R.string.notification_channel_name)
  
      val defaultSoundUri = RingtoneManager
              .getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
  
      val notificationBuilder = NotificationCompat
              .Builder(this, channelId)
              .setSmallIcon(R.drawable.login_logo)
              .setContentTitle("Title")
              .setContentText(messageBody)
              .setAutoCancel(true)
              .setSound(defaultSoundUri)
              .setContentIntent(pendingIntent)
  
      notificationManager = getSystemService(Context.NOTIFICATION_SERVICE)
              as NotificationManager
  
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
          val channel = NotificationChannel(channelId,
                  channelName,
                  NotificationManager.IMPORTANCE_DEFAULT)
          notificationManager.createNotificationChannel(channel)
      }
  
      notificationManager.notify(0 /* ID of notification */, notificationBuilder.build())
  }
  </code></pre>