Start a new topic

push and receive notification


I am really sorry if it is a  simple question but i am a beginner

in my app i need when  user change some thing in the database other users get notified so i followed this link

but i don not know how to continue this link seems to deal when i receive notification so how to send one? is there any other tutorial or sample code that i can follow

thanks in advance 

Hi Soha,

You need to do this using Kinvey Business Logic (BL).

You can set up different types of Kinvey BL scripts depending on each use case ( and execute it to send out push or other notifications accordingly.


  1. Kinvey Business Logic:
  2. Kinvey BL reference for sending push notifications:

E.g. for a specific collection in data store (database), you can create BL collection hook called onPostSave which will be triggered when an entity in that collection is created/updated.



Kinvey Support

thank you  very much i read the reference and was triying the samples but i cannot receive any thing in the test devise iam using i have followed this likk  impleting the classes GCMService and receiver but i do not know how can i use them in my code i just made logs in all methods in GCMService class but i don't see any thing any help please?


Have you registered the device to receive push notifications? Are you able to confirm if that part is happening properly?

The documentation is covered here:

Also, what is the BL output you are getting when you execute the BL code?



yes i put this line myClient.push().initialize(getApplication());   after the user log in in my code and i used a sample of BL in your documentation 

here it is 

function onPostSave(request, response, modules) {


   var push = modules.push, collectionAccess = modules.collectionAccess;

    collectionAccess.collection('user').find({"username": 'student'}, function (err, userColl) {

      if (err) {'Query failed: '+ err);

      } else { 'sucess'+userColl);

          push.broadcastMessage("Hello", function(err, result) {


    "error"+ err);






but where in my android app can how can i see the message in my android app i crated logs in GCMReceiver and GCMService and made to objects of them in my activity but dont know what should i do next?






Can you confirm a couple of things for me:

  1. Have you set up GCM API key and added it in Kinvey console?
  2. Are you able to manually confirm if push initialization completes? The way you can do it is by observing _messaging column in users's information - it should have a valid json structure along with pushTokens information.

If yes, can you try to send a sample push notification using Kinvey console?

Let me know how it goes.

Login or Signup to post a comment