fcm icon indicating copy to clipboard operation
fcm copied to clipboard

SnederId Mismatch

Open raghunathmestry opened this issue 4 years ago • 1 comments

hi I got an error in previous days from this module here is the code and screenshot, please I need help to resolve this issue. error is SenderId mismatch

  1. I create two SHA 1 Keys one for development and the second one is for production.

  2. Also, I change my SHA 1 key from the google developer account for the google play store uploaded file. any problems with the above changes in the project?

     $title = 'My Notification Title';
     $body = 'My Notification Body';
    
     $notification = Notification::fromArray([
         'title' => $title,
         'body' => $body,
     ]);
    
     $notification = Notification::create($title, $body);
    
     $messaging = app('firebase.messaging');
     $deviceToken = 'i add my token here.....';
    
     $message = CloudMessage::withTarget('token', $deviceToken)->withNotification($notification); // optional;
    
     $message = CloudMessage::fromArray([
         'token' => $deviceToken
     ]);
     try {
         ...
         $messaging->send($message);
     }  catch (\Kreait\Firebase\Exception\MessagingException $e) {
         dd($e->errors());
     }
    

Untitled

raghunathmestry avatar Sep 03 '20 07:09 raghunathmestry

You should generate token on frontend side, clone this project and in messaging folder follow this steps https://github.com/firebase/quickstart-js/blob/master/messaging/README.md

dimacodecare avatar Sep 11 '20 13:09 dimacodecare

This is an old issue so I'm going to close it. Please reach out if it's still a problem.

dwightwatson avatar Aug 29 '22 11:08 dwightwatson