Skip to content
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

[question]: Critical Notifications not working #57

Closed
1 task done
jeremywj opened this issue Apr 28, 2023 · 3 comments
Closed
1 task done

[question]: Critical Notifications not working #57

jeremywj opened this issue Apr 28, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@jeremywj
Copy link

How can we help?

If I use the onesignal "Send message" GUI form on the website I can get a critical alert on my test phone just fine. This tells me my app is fine. However, through the API with this plugin I can't get critical notifications to work. See code below. The notification with the code below will come through if I turn DND off. However, with DND I get nothing even though I should.

const notification = new OneSignal.Notification();
notification.app_id = ONESIGNAL_APP_ID;
notification.include_player_ids = [pushId];
notification.include_player_ids = [pushId];
notification.priority = 10;
notification.ios_interruption_level = "critical";
notification.mutable_content = true;
notification.data = {
type: "test"
}
notification.android_channel_id = getAudioTag(sound).android;

notification.ios_sound = getAudioTag(sound).ios;
notification.contents = {
    en: "Test Push Notification @ " + pageGetTime((Date.now() / 1000), users.getUserData(userId).timeFormat)
};
notification.headings = {
    "en": "Test"
}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jeremywj
Copy link
Author

Heh, after spending a whole day trying to figure out what I was doing wrong, I figured it out minutes after posting this.

The API here simply does not support it.

dist/modals/Notification.d.ts & .../Notification.js need to have this option added. Major oversight in my opinion and should be added asap.

@emawby emawby added the enhancement New feature or request label Apr 28, 2023
@emawby
Copy link
Contributor

emawby commented Apr 28, 2023

Thank you for reporting this gap. It has been noted!

@nan-li
Copy link
Contributor

nan-li commented May 9, 2024

Closing since OP has reported this issue in #72

@nan-li nan-li closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants