Edujugon / PushNotification

PHP and Laravel Package to send push notifications to Android and IOS devices.
MIT License
478 stars 159 forks source link

FCM: Android not receiving push while iOS yes #79

Closed Neogene closed 5 years ago

Neogene commented 5 years ago

Hi, I use following code with FCM, inside $tokens there is a mixed array of iOS and Android tokens, running it iOS receives proper notifications, while android devices none. Using firebase console properly sends notifications.

Note: i had to set priority to high otherwise iOS didn't receive notifications, but Android still no, any help? best regards.

$push = new PushNotification('fcm'); $push ->setMessage([ 'notification' => [ 'title'=>'Title', 'body'=>$message, 'sound' => 'default' ] ] ) ->setConfig(['dry_run' => false,'priority' => 'high']) ->setApiKey($API_KEY) ->setDevicesToken($tokens) ->send();

Neogene commented 5 years ago

Sorry my mistake, wrong token !