Comments (3)
I edited your code block for better readabilty.
I am quite confident that the package and its underlying library works. If you don't get an error it means that the Firebase API has received and accepted your message. Now, there are two possibilities where the issue lies:
-
Firebase has accepted the message but didn't deliver it. In that case, there's nothing we can do from our side of the interaction. If you're convinced that everything is correct code-wise, you should open a support ticket with Google (but only after checking (2) 😅)
-
The device that you expect to get notified is not subscribed to the topic you're sending the notification to.
To check (2), you'll need the registration token of the device that you're testing with. For example, if you're using the Firebase Web Client, you can do this with firebase.messaging.getToken()
.
Once you have the token, you can get the topics it's subscribed to by inspecting the App instance as described at https://firebase-php.readthedocs.io/en/5.8.1/cloud-messaging.html#working-with-topic-subscriptions
$messaging = app('firebase.messaging');
$appInstance = $messaging->getAppInstance('<registration token>');
/** @var \Kreait\Firebase\Messaging\TopicSubscriptions $subscriptions */
$subscriptions = $appInstance->topicSubscriptions();
foreach ($subscriptions as $subscription) {
echo "{$subscription->registrationToken()} is subscribed to {$subscription->topic()}\n";
}
If the topic appears in that list, the device/registration token is subscribed to the topic, and you should proceed with (1).
If the topic doesn't appear in the list, your device is not subscribed to the topic and cannot receive a message sent to that topic. In this case: subscribe the device to the topic 😅
from laravel-firebase.
Thanks, i will first fix this from my react native client. I have tested this with a another alternative code in that it works smoothly. Yes token id was missing in the above.
from laravel-firebase.
I'm closing this now because this is most likely nothing that can be fixed from the side of the Laravel package or SDK, but feel free to add further comments or share your findings. 🤞
from laravel-firebase.
Related Issues (20)
- Call to undefined method Google\Cloud\Firestore\DocumentSnapshot::delete() HOT 1
- how to remove image from firebase using download url? HOT 1
- how to set up pagination? Please help HOT 1
- Next release HOT 2
- No publishable resources for tag []. Publishing complete. HOT 5
- Callable functions
- SenderId mismatch HOT 7
- Laravel error HOT 2
- getting error HOT 1
- Incompatibility with Eloquent Resources? HOT 1
- Confirm email verification Support
- Its not supported php 8. Please fix this
- Push notifications are not getting displayed in IOS and Android randomly HOT 1
- Be able to override FirestoreClient::DEFAULT_DATABASE HOT 7
- Support PHP8.3 HOT 2
- Firestore insert or update problem when using laravel-octane HOT 3
- Auto discovery not working similar to v4.x HOT 6
- Cannot mock final class for phpunit tests as it's return type is other final class HOT 1
- Support symfony/cache version 7 HOT 3
- Make Support For Laravel 11 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-firebase.