Start a new topic

What are some examples of push messaging between?

Are there any examples of creating a two way messaging between two usernames?

Levi, I don't believe that we have anything publicly available of that nature, but it is fairly trivial javascript. If you take a look at our Business logic reference for push (Available here: http://devcenter.kinvey.com/html5/reference/business-logic/reference.html#push-module ) you should see an example that is roughly what you are trying to accomplish, though not exactly (this will send a push to a username, but won't handle how you select / pass into that endpoint). Please let me know if you have any additional questions, Thanks,
Okay, makes sense. I am brand new to the whole cloud computing. The whole json code is all very new to me. Right now, I am fooling around with it and have some ideas for future projects so any code examples would help. When you said, "The easiest way to set this up would be to create a custom endpoint in Business logic that accepts a username and a message and then passes that off to push." Do you have an example of what that would look like? Thank you.
Levi, There's a HUGE amount of unknowns here that we can't really fill in for you because of how you structured your app. In general the way to do this would be to: 1. Have some way for users to see one another (this can be reliant on making groups and managing ACL's, or by making users public, among other options). 2. Allow the users that can see one another to send eachother something (I'm sure you'd want some permissions around this). 3. The user selects another user, and sends them a push. 4. The backend knows what user is being pushed to, gets the username / user ID, which you can then use to get the messaging_ / push_ fields. 5. From this point on, the flow of the push would be fairly normal. The easiest way to set this up would be to create a custom endpoint in Business logic that accepts a username and a message and then passes that off to push. Please let me know if you have any other questions, Thanks,
What code I have right now is: > function onRequest(request, response, modules) { var iOSAps = request.body.iosaps; var push = modules.push; var iOSExtras = request.body.iosextras; var androidPayload = request.body.androidpayload; var androidmessage = androidPayload.message; var message = request.body.message; push.broadcastPayload(iOSAps, iOSExtras, androidPayload); response.complete( 200 ); }
I connected my kinvey to the google cloud messaging api.
Login or Signup to post a comment