Firebase onMessageReceived not called when app is inactive

前端 未结 5 1155
醉话见心
醉话见心 2021-01-22 05:23

I am using Firebase Cloud Messaging on Android.

  • I can successfully receive notification and data messages when the app is in the foreground.
  • The documen
5条回答
  •  遇见更好的自我
    2021-01-22 06:09

    Add action in your manifest activity like below:

    
       
           
           
       
    
    

    And add click_action in your sending notification server(my example is PHP)

    $notification= array(
                    'title'     => '快訊',
                    "body" => "市場大特價",
                    'tickerText'    => 'Ticker text here',
                    'vibrate'   => 1,
                    'sound'     => 1,
                    'largeIcon' => 'large_icon',
                    'smallIcon' => 'small_icon',
                    'click_action' => 'AnyNameYouWant');
    

提交回复
热议问题