-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Send Notification with invalid or not subscribed player IDs #810
Comments
Hello! We removed postNotification because recommend using our API to send notifications rather than sending them on the device level due to the potential security issue of exposing another user's id on the device. We have API documentation on how to send a notification here: https://documentation.onesignal.com/reference/create-notification If this doesn’t work for your use case, could you explain what your use case is? |
I also tried using the API, but with e.g. endpoint |
@aristidenx |
An error like |
@Arhidev If some player_ids are invalid or not subscribed, the others should still receive it.
|
What happened?
How can we help?
Hello to you !
With older versions of onesignal, it was simple and efficient to send notifications with the following code:
(OneSignal.shared.postNotification(notification)
static void sendSimpleMessage({String msg, String playerId}) async { var notification = OSCreateNotification( playerIds: [playerId], content: msg, heading: "Cdou", buttons: [OSActionButton(text: "voir", id: "id1"),]); try { await OneSignal.shared.postNotification(notification) .then((value) => Constant.alertToast(msg: "Succés!", color: Colors.green)).catchError((er) {}); }catch (e) { // TODO } }
But currently impossible, or please tell me how to do it!
Thank you very much
Steps to reproduce?
What did you expect to happen?
To be able to send notifications following the same process as OneSignal.shared.postNotification(notification)
OneSignal Flutter SDK version
onesignal_flutter: ^5.0.4
Which platform(s) are affected?
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: