-
Notifications
You must be signed in to change notification settings - Fork 333
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
Support iOS 12 Critical Alerts #113
Conversation
Created an issue for book-keeping sake. Closes #114. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! would love to get this merged. I just added a few comments for the sake of consistency. BTW i'm curious if you guys using this library at Braze? Thanks, Adam
@@ -16,7 +16,7 @@ type aps struct { | |||
Category string `json:"category,omitempty"` | |||
ContentAvailable int `json:"content-available,omitempty"` | |||
MutableContent int `json:"mutable-content,omitempty"` | |||
Sound string `json:"sound,omitempty"` | |||
Sound interface{} `json:"sound,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you able to make this a sound struct similar to what I did for the alert struct.
That way for consistency with the existing they could either use like this:
payload.NewPayload().SoundName("..").SoundVolume("..")
or like this:
payload.NewPayload().Sound(map[string]interface{}{ .. })
@@ -84,7 +84,7 @@ func (p *Payload) UnsetBadge() *Payload { | |||
// This will play a sound from the app bundle, or the default sound otherwise. | |||
// | |||
// {"aps":{"sound":sound}} | |||
func (p *Payload) Sound(sound string) *Payload { | |||
func (p *Payload) Sound(sound interface{}) *Payload { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can still stay as interface, that way it can accept either a string, map or the sound struct.
@sideshow Thanks for the review, I've went ahead and added a SoundName/SoundVolume interface. Yes, we're currently using this library, thanks for making it available! |
The aps sound field in the APNS payload can now be a dictionary in order to send critical alerts for iOS 12 devices.
You can read about it here.
These changes add support for that as well as a test case.
cc @froodian