brozot / Laravel-FCM

Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud Messaging (FCM).
MIT License
885 stars 398 forks source link

Not working on iOS devices #214

Open Shagun-29 opened 3 years ago

Shagun-29 commented 3 years ago

Notifications are received on android but not iOS devices.

 // fcm_id <--- for device
        $optionBuilder = new OptionsBuilder();
        $token = $fcm_id;
        $optionBuilder->setTimeToLive(60*20);
        $notificationBuilder = new PayloadNotificationBuilder($title);
        $notificationBuilder->setBody($builderMsg)->setSound('default');
        $dataBuilder = new PayloadDataBuilder();
        $dataBuilder->addData(['message' => "Message Sent"]);
        $option = $optionBuilder->build();
        $notification = $notificationBuilder->build();
        $data = $dataBuilder->build();
        $downstreamResponse = FCM::sendTo($token, $option, $notification, $data);
        $downstreamResponse->numberSuccess();
        $downstreamResponse->numberFailure();
        $downstreamResponse->numberModification();
mstockbridge2000 commented 2 years ago

Any luck with this issue? We can't figure it out.

TopDev114 commented 3 weeks ago

Looks like that, I tried but I am also cannot receive notification. Did you solve it?