I'm a newbie to parse and wanna make sure I figured it out correctly + have some Q.'s on the way so please help a newbie and be patient :)

1) from my ios app (didRegisterForRemoteNotificationsWithDeviceToken) I call my python server RegisterApi and send the device token ---> in my register method I should call

connection.request('POST', '/1/installations', json.dumps({
"deviceType": "ios",
"deviceToken": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"channels": [
   "AllUsers"
]
}), {
  "X-Parse-Application-Id": "<My Parse-Application-Id>",
  "X-Parse-REST-API-Key": "<My Parse-REST-API-Key>",
  "Content-Type": "application/json"
})

should I save the returned objectId in my DB for further uses?

2) Once in a week I wish to send a general notification to all users - the following code will do the trick?

connection.request('POST', '/1/push', json.dumps({
   "channels": [
     "AllUsers"
   ],
   "data": {
     "alert": "Have a great weekend :)"
   }
 }), {
  "X-Parse-Application-Id": "<My Parse-Application-Id>",
  "X-Parse-REST-API-Key": "<My Parse-REST-API-Key>",
  "Content-Type": "application/json"
})

3) some methods in my server send notification to a selected group that is dynamic and changes as a result of a query - for example all users who have birthdays or all the males all students etc. assuming my query has all the users and their token id's should I:

  1. update all the relevant users with a new channel --> send the notification -->delete the channel: is there a way to delete a channel? or do I need to run an update and remove the channel from all users, will that result in removing the channel?
  2. can I create a push message with token id's and no channels nor objectId's
  3. can I keep a channel and only update the tokens or objectId's in it
  4. does an update require an objectId as well as device token

4) In my app all notifications are result of server actions, in this case do I have to implement a client side code or like Urban Airship I can write only server side code

If you reached this line and willing to answer my questions I'd like to Thank you for your time & help

Related posts

Recent Viewed