Skip to content

Commit 1279a42

Browse files
Document how to set title/subtitle/body for apns (#640)
I sort of just guessed at this method of getting more advanced data into the APNS body and it worked, figured it'd be better if it was explicit. Co-authored-by: Ben Langfeld <blangfeld@powerhrg.com>
1 parent 4c98e17 commit 1279a42

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ n = Rpush::Apnsp8::Notification.new
8383
n.app = Rpush::Apnsp8::App.find_by_name("ios_app")
8484
n.device_token = "..." # hex string
8585
n.alert = "hi mom!"
86+
# n.alert = { title: "push title", subtitle: "more to say", body: "hi mom!" }
8687
n.data = { foo: :bar }
8788
n.save!
8889
```
@@ -107,6 +108,7 @@ n = Rpush::Apns2::Notification.new
107108
n.app = Rpush::Apns2::App.find_by_name("ios_app")
108109
n.device_token = "..." # hex string
109110
n.alert = "hi mom!"
111+
# n.alert = { title: "push title", subtitle: "more to say", body: "hi mom!" }
110112
n.data = {
111113
headers: { 'apns-topic': "BUNDLE ID" }, # the bundle id of the app, like com.example.appname. Not necessary if set on the app (see above)
112114
foo: :bar
@@ -133,6 +135,7 @@ n = Rpush::Apns::Notification.new
133135
n.app = Rpush::Apns::App.find_by_name("ios_app")
134136
n.device_token = "..." # hex string
135137
n.alert = "hi mom!"
138+
# n.alert = { title: "push title", subtitle: "more to say", body: "hi mom!" }
136139
n.data = { foo: :bar }
137140
n.save!
138141
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy