Skip to content
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

Update push-notification.md #834

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 45 additions & 37 deletions _includes/rest/push-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,10 @@ curl -X POST \
"Giants",
"Mets"
],
"data": {
"alert": "The Giants won against the Mets 2-3."
}
"notification": {
"title": "Won",
"body": "The Giants won against the Mets 2-3."
}
}' \
<span class="custom-parse-server-protocol">https</span>://<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span><span class="custom-parse-server-mount">/parse/</span>push
</code></pre>
Expand All @@ -370,9 +371,10 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"Giants",
"Mets"
],
"data": {
"alert": "The Giants won against the Mets 2-3."
}
"notification": {
"title": "Won",
"body": "The Giants won against the Mets 2-3."
}
}), {
"X-Parse-Application-Id": "<span class="custom-parse-server-appid">${APPLICATION_ID}</span>",
"X-Parse-REST-API-Key": "<span class="custom-parse-server-restapikey">${REST_API_KEY}</span>",
Expand Down Expand Up @@ -475,8 +477,9 @@ curl -X POST \
"where": {
"injuryReports": true
},
"data": {
"alert": "Willie Hayes injured by own pop fly."
"notification": {
"title": "injuryReports",
"body": "Willie Hayes injured by own pop fly."
}
}' \
<span class="custom-parse-server-protocol">https</span>://<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span><span class="custom-parse-server-mount">/parse/</span>push
Expand All @@ -489,9 +492,10 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"where": {
"injuryReports": True
},
"data": {
"alert": "Willie Hayes injured by own pop fly."
}
"notification": {
"title": "injuryReports",
"body": "Willie Hayes injured by own pop fly."
}
}), {
"X-Parse-Application-Id": "<span class="custom-parse-server-appid">${APPLICATION_ID}</span>",
"X-Parse-REST-API-Key": "<span class="custom-parse-server-restapikey">${REST_API_KEY}</span>",
Expand All @@ -515,8 +519,9 @@ curl -X POST \
"channels": "Giants",
"scores": true
},
"data": {
"alert": "The Giants scored a run! The score is now 2-2."
"notification": {
"title": "Scores",
"body": "The Giants scored a run! The score is now 2-2."
}
}' \
<span class="custom-parse-server-protocol">https</span>://<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span><span class="custom-parse-server-mount">/parse/</span>push
Expand All @@ -530,9 +535,10 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"channels": "Giants",
"scores": True
},
"data": {
"alert": "The Giants scored a run! The score is now 2-2."
}
"notification": {
"title": "Scores",
"body": "The Giants scored a run! The score is now 2-2."
}
}), {
"X-Parse-Application-Id": "<span class="custom-parse-server-appid">${APPLICATION_ID}</span>",
"X-Parse-REST-API-Key": "<span class="custom-parse-server-restapikey">${REST_API_KEY}</span>",
Expand Down Expand Up @@ -566,8 +572,9 @@ curl -X POST \
}
}
},
"data": {
"alert": "Free hotdogs at the Parse concession stand!"
"notification": {
"title": "Parse concession stand!",
"body": "Free hotdogs at the Parse concession stand!"
}
}' \
<span class="custom-parse-server-protocol">https</span>://<span class="custom-parse-server-url">YOUR.PARSE-SERVER.HERE</span><span class="custom-parse-server-mount">/parse/</span>push
Expand All @@ -594,9 +601,10 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
}
}
},
"data": {
"alert": "Free hotdogs at the Parse concession stand!"
}
"notification": {
"title": "Parse concession stand!",
"body": "Free hotdogs at the Parse concession stand!"
}
}), {
"X-Parse-Application-Id": "<span class="custom-parse-server-appid">${APPLICATION_ID}</span>",
"X-Parse-REST-API-Key": "<span class="custom-parse-server-restapikey">${REST_API_KEY}</span>",
Expand Down Expand Up @@ -639,7 +647,7 @@ curl -X POST \
"channels": [
"Mets"
],
"data": {
"notification": {
"alert": "The Mets scored! The game is now tied 1-1.",
"badge": "Increment",
"sound": "cheering.caf",
Expand All @@ -656,7 +664,7 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"channels": [
"Mets"
],
"data": {
"notification": {
"alert": "The Mets scored! The game is now tied 1-1.",
"badge": "Increment",
"sound": "cheering.caf",
Expand Down Expand Up @@ -685,7 +693,7 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"channels": [
"Indians"
],
"data": {
"notification": {
"action": "com.example.UPDATE_STATUS",
"alert": "Ricky Vaughn was injured during the game last night!",
"name": "Vaughn",
Expand Down Expand Up @@ -715,7 +723,7 @@ curl -X POST \
-H "Content-Type: application/json" \
-d '{
"expiration_time": "2015-03-19T22:05:08Z",
"data": {
"notification": {
"alert": "Season tickets on sale until March 19, 2015"
}
}' \
Expand All @@ -727,7 +735,7 @@ connection = httplib.HTTPSConnection('<span class="custom-parse-server-url">YOUR
connection.connect()
connection.request('POST', '<span class="custom-parse-server-mount">/parse/</span>push', json.dumps({
"expiration_time": "2015-03-19T22:05:08Z",
"data": {
"notification": {
"alert": "Season tickets on sale until March 19, 2015"
}
}), {
Expand All @@ -751,7 +759,7 @@ curl -X POST \
-d '{
"push_time": "2015-03-13T22:05:08Z",
"expiration_interval": 518400,
"data": {
"notification": {
"alert": "Season tickets on sale until March 19, 2015"
}
}' \
Expand Down Expand Up @@ -793,7 +801,7 @@ curl -X POST \
"where": {
"deviceType": "android"
},
"data": {
"notification": {
"alert": "Your suitcase has been filled with tiny robots!"
}
}' \
Expand All @@ -807,7 +815,7 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"where": {
"deviceType": "android"
},
"data": {
"notification": {
"alert": "Your suitcase has been filled with tiny robots!"
}
}), {
Expand All @@ -830,7 +838,7 @@ curl -X POST \
"where": {
"deviceType": "ios"
},
"data": {
"notification": {
"alert": "Your suitcase has been filled with tiny apples!"
}
}' \
Expand All @@ -844,7 +852,7 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"where": {
"deviceType": "ios"
},
"data": {
"notification": {
"alert": "Your suitcase has been filled with tiny apples!"
}
}), {
Expand All @@ -867,7 +875,7 @@ curl -X POST \
"where": {
"deviceType": "winrt"
},
"data": {
"notification": {
"alert": "Your suitcase has been filled with tiny glass!"
}
}' \
Expand All @@ -881,7 +889,7 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"where": {
"deviceType": "winrt"
},
"data": {
"notification": {
"alert": "Your suitcase has been filled with tiny glass!"
}
}), {
Expand All @@ -904,7 +912,7 @@ curl -X POST \
"where": {
"deviceType": "winphone"
},
"data": {
"notification": {
"alert": "Your suitcase is very hip; very metro."
}
}' \
Expand All @@ -918,7 +926,7 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"where": {
"deviceType": "winphone"
},
"data": {
"notification": {
"alert": "Your suitcase is very hip; very metro."
}
}), {
Expand Down Expand Up @@ -946,7 +954,7 @@ curl -X POST \
"user_id": "user_123"
},
"push_time": "2015-03-19T12:00:00Z",
"data": {
"notification": {
"alert": "You previously created a reminder for the game today"
}
}' \
Expand All @@ -961,7 +969,7 @@ connection.request('POST', '<span class="custom-parse-server-mount">/parse/</spa
"user_id": "user_123"
},
"push_time": "2015-03-19T12:00:00Z",
"data": {
"notification": {
"alert": "You previously created a reminder for the game today"
}
}), {
Expand Down