The Created CFMs don't listed on the firebase console?
nakarimi opened this issue · comments
I sent the request to create notification with Firebase, it return success, but actually I can't receive the notification on the phone, also the notifications don't list on the table of notification on the console panel.
My code the the result that returns on success.
$path = base_path('config/fooddelivery-firebase.json');
$title = 'My Notification Title';
$body = 'My Notification Body';
$notification = Notification::create($title, $body);
$factory = (new Factory)->withServiceAccount($path);
$messaging = $factory->createMessaging();
$message = CloudMessage::withTarget('topic', 'AsanFood')
->withNotification($notification);
try {
return $messaging->send($message);
// Result:
// {
// "name": "projects/fooddelivery-cc39b/messages/757376859954639368"
// }
} catch (InvalidMessage $e) {
print_r($e->errors());
}
die;
Should it be listed on the table, or just should receive it on the phone? what is wrong with this?
Your message looks fine but I have to add that valid messages to topics always return success - if no device is subscribed to that topic, no message will be delivered.
You can check which topics a device is subscribed to with the AppInstance management API: https://firebase-php.readthedocs.io/en/5.x/cloud-messaging.html#app-instance-management
Please note that only messages sent from the console will show up in the console - messages sent from an SDK will not.