Skip to content

I used this package but u dont know why its not sent a notification? it's give me a blank page ? #31

@samiaMH

Description

@samiaMH

//////////////////// method in controller ////////////////////
public function sendnotification(){
$registrationIds= array();
$recipients = Fcm_info::select('token')->get();

for ($i = 0, $c = count($recipients); $i < $c; ++$i) {
    array_push($registrationIds,  $recipients[$i]['token']);
    fcm()
          ->to($registrationIds) // $recipients must an array
          ->priority('normal')
          ->notification([
              'title' => 'Test FCM',
              'body' => 'This is a test of FCM',
          ])
          ->send();
 }

}
//////////////////// route ////////////////////

Route::get('/sendnotification','FcmController@sendnotification')->name('sendnotification');

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions