Clicking on notification doesn't open mentioned activity

后端 未结 10 1143
感动是毒
感动是毒 2020-12-09 16:26

I am trying to open an Activity when the notification is clicked and below is my code.

Intent intent = new Intent(this.getApplicationContext(),         


        
10条回答
  •  無奈伤痛
    2020-12-09 16:55

    Thats the intented behaviour. If your app is in background, notification is created by android system which does not have your pendingIntent action.So it does not work. In the foreground case it works because notification is created by your code.

    Please check the doc in the below link. https://firebase.google.com/docs/notifications/android/console-device#receive_and_handle_messages

提交回复
热议问题