Skip to content

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