nomad-cli / houston

Apple Push Notifications; No Dirigible Required
http://nomad-cli.com
MIT License
2.93k stars 229 forks source link

Add support of mutable-content: 1 (for iOS10 push notifications with attachments) #124

Closed atkit closed 7 years ago

atkit commented 8 years ago

Convenience change for media attachments on iOS10.

Also possible to achieve the same result with:

notification.custom_data = { 'aps' => { 'mutable-content' => '1' }, 'image' => "https://url/to/image" }
maddox commented 8 years ago

Will this be merged soon?

atkit commented 8 years ago

it needs to be merged by @markquezada

markquezada commented 8 years ago

@atkit @maddox wish I could but I don't have commit access. Still waiting on @mattt.

samjarman commented 7 years ago

+1!

@mattt can you please take a look? / Give an update :) Thanks

jdraths commented 7 years ago

I went ahead without this per the following:



# Create a notification that alerts a message to the user, plays a sound, and sets the badge on the app
notification = Houston::Notification.new(device: token)
notification.alert = "Hello, World!"
notification.badge = 57
notification.sound = "sosumi.aiff"
notification.category = "INVITE_CATEGORY"
notification.content_available = true

# the 'attachment-url` key in this dictionary can be custom named and parsed by your ios app
notification.custom_data = { 'aps' => { 'mutable-content' => 1 }, 'attachment-url' => "https://whatever.com/whateverphoto.jpg" }

APN.push(notification)
dankimio commented 7 years ago

Implemented in #118 and #137.