I point out an anomaly, which could be useful to others!
In the plugin and firebase documentation it is said to insert "click_action" in the payload. But if I enter "click_action" => "FCM_PLUGIN_ACTIVITY", the app won't start when I click on the notification!
I spent hours figuring out why the app didn't start from the notification! Then I removed "click_action" => "FCM_PLUGIN_ACTIVITY" and everything works perfectly!
For completeness, I report the json I send to FCM via PHP script
I point out an anomaly, which could be useful to others! In the plugin and firebase documentation it is said to insert "click_action" in the payload. But if I enter "click_action" => "FCM_PLUGIN_ACTIVITY", the app won't start when I click on the notification!
I spent hours figuring out why the app didn't start from the notification! Then I removed "click_action" => "FCM_PLUGIN_ACTIVITY" and everything works perfectly!
For completeness, I report the json I send to FCM via PHP script
` $notification = array( "title" => $titolo, "body" => $messaggio, "icon" => "fcm_push_icon", "sound" => "default", "tag" => $tag, "color" => "#0271ac", //"click_action" => "FCM_PLUGIN_ACTIVITY", // COMMENTED!!!! "collapse_key" => $tag );
$data = array( 'message' => $messaggio );
$fields = array ( 'to' => $token, 'data' => $data, 'notification' => $notification, 'collapse_key' => $tag, 'priority' => 'high', 'content_available' => true ); `
I'm using Cordova 8.1.2, platform Android 7.1.4