Skip to content

Interruption Level for APS to deliver time-sensitive notifications for IOS #81

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cyberpwnn
Copy link

fixes #80

Simply adds time-sensitive as a property for APS and allows it to play instead of getting rejected on firebases end.

You can now deliver time sensitive notifications with sound on IOS

  • Added String? interruptionLevel and String? soundRaw to the Aps model
  • If sound is defined, that is serialized, otherwise soundRaw is, if neither are defined, the sound field is not included in the map.
MulticastMessage(
  tokens: ...,
  data: ...,
  notification: Notification(title: title, body: body),
  apns: ApnsConfig(
    headers: {"apns-priority": "5"}, // Firebase requires 5, anything higher is rejected
    payload: ApnsPayload(
      aps: Aps(
        soundRaw: "default", // Makes it play a sound on ios. Using "CriticalSound" object rejects the notification on firebase.
        interruptionLevel: "time-sensitive", // Actually makes the notification time sensitive
      ),
    ),
  ),
)

This is the correct way to deliver Aps payload with time-sensitive and with actual sound, the CriticalSound object is not up to aps spec and it just gets rejected by firebase, notifications wont even deliver using that.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


cyberpwn seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cant make Aps Time Sensitive
2 participants