evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 681 forks source link

FCM Payload Custom_notification runs only on Android Emulator #1091

Open PdxMehmet opened 5 years ago

PdxMehmet commented 5 years ago

I've followed all the tutorial about how to implement correct fcm payload, and ir works on emulator android but not after building a release on real device.

It seems that the "custom notification" is not recognized and i can only send "notification" in the payload :

$url = 'http://fcm.googleapis.com/fcm/send';
$fields = array (
'to' => $id,
'data' => array (
'custom_notification' => array (
'title'  => 'Nouvelle offre de service !',
'body'  => 'Vous avez',
'targetScreen' =>"offer",
 'ID' =>"200",
 'color' => '#3e5baa',
'priority' => 'high',
 'sound' => 'default',  
'icon' => "ic_launcher",
'show_in_foreground'=> true,
 )
 )
);

Do you have any idea ?