Start a new topic

Receiving Push Notification but without message body in android

I am getting notifications on my android device which I am sending from Kinvey. But the message which I am sending , I am not getting that in the notification. I am receiving blank notification with heading of GCM Message.


I have tried it using Engagement-> Push but from there also ia m receiving only blank noticiation but not the message body like "Hello".




Shweta,

Please take a look at following links:
http://devcenter.kinvey.com/android-v3.0/guides/push#

Also take a look at triggering push notifications from Business Logic http://devcenter.kinvey.com/android-v3.0/guides/business-logic#Triggeringpushnotifications



Thanks,

Pranav

Kinvey

Hi Pranav,


This is the code which I am using to send notification to users. It is showing me 200 Ok response but I am not receiving any message.

 My request body is :

{

"username":"Vijay"

}


This username is already added in the list of users of my project.

function onRequest(request, response, modules){
var collectionAccess = modules.collectionAccess,
    userCollection = collectionAccess.collection('user'),
    push = modules.push;
    // Find all users who's favoriteTeam matches the incomming request's winning team
    userCollection.find({"username": request.username}, function(err, user){
   
        // Each message is customized
        user.forEach(function(doc){           
         // Render the message to send
            var message = "Hello";
            // Send the push
      
            push.sendMessage(user, message);
       
        });
    });
   
  response.complete();
}

 

Login or Signup to post a comment