From a1ccae3a4b86ba609384c49edca7a3c8129169da Mon Sep 17 00:00:00 2001 From: Prasanna Date: Tue, 8 Jun 2021 13:58:43 +0530 Subject: [PATCH] Update push-notification.md Updated with new push notification documentation --- _includes/rest/push-notifications.md | 82 +++++++++++++++------------- 1 file changed, 45 insertions(+), 37 deletions(-) diff --git a/_includes/rest/push-notifications.md b/_includes/rest/push-notifications.md index 22dc9c830..bfcf73ca8 100644 --- a/_includes/rest/push-notifications.md +++ b/_includes/rest/push-notifications.md @@ -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." + } }' \ https://YOUR.PARSE-SERVER.HERE/parse/push @@ -370,9 +371,10 @@ connection.request('POST', '/parse/${APPLICATION_ID}", "X-Parse-REST-API-Key": "${REST_API_KEY}", @@ -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." } }' \ https://YOUR.PARSE-SERVER.HERE/parse/push @@ -489,9 +492,10 @@ connection.request('POST', '/parse/${APPLICATION_ID}", "X-Parse-REST-API-Key": "${REST_API_KEY}", @@ -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." } }' \ https://YOUR.PARSE-SERVER.HERE/parse/push @@ -530,9 +535,10 @@ connection.request('POST', '/parse/${APPLICATION_ID}", "X-Parse-REST-API-Key": "${REST_API_KEY}", @@ -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!" } }' \ https://YOUR.PARSE-SERVER.HERE/parse/push @@ -594,9 +601,10 @@ connection.request('POST', '/parse/${APPLICATION_ID}", "X-Parse-REST-API-Key": "${REST_API_KEY}", @@ -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", @@ -656,7 +664,7 @@ connection.request('POST', '/parse//parse/YOUR connection.connect() connection.request('POST', '/parse/push', json.dumps({ "expiration_time": "2015-03-19T22:05:08Z", - "data": { + "notification": { "alert": "Season tickets on sale until March 19, 2015" } }), { @@ -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" } }' \ @@ -793,7 +801,7 @@ curl -X POST \ "where": { "deviceType": "android" }, - "data": { + "notification": { "alert": "Your suitcase has been filled with tiny robots!" } }' \ @@ -807,7 +815,7 @@ connection.request('POST', '/parse//parse//parse//parse//parse/