Start a new topic

Not able to receive push notification in android phone

Hi,


I am not receiving push notifications on my android phone.I have registered the device on kinvey through 


/push/appkey/register-device

{

  "platform": "android",

  "deviceId": "my device id",

 "userId": "my user id"

}


Once registered I have added my custome end point as :


 

function onRequest(request, response, modules){

var push = modules.push;

push.broadcastMessage('Test');

response.complete();

 

}

But I am not getting any message on my registered device.


This is what I am getting when sending request and getting response:


Request

 

POST /rpc/kid_/custom/Test HTTP/1.1
Host: baas.kinvey.com
Content-Type:application/json
Authorization: Basic M0OWJlYTM0OTRlZmJmN2ZiZWJmYg==
X-Kinvey-API-Version: 3 {
  "favoriteTeam":"Hello",
   "winningTeam": "Boston Red Sox"
 }

Response

HTTP/1.1 200 OK
Content-Type: application/json
X-Kinvey-API-Version: 3
X-Kinvey-Request-Id: f5aa1ffb345c8d3438f67fb
X-Powered-By: Express

{}




Hi Wani,


Sorry for late reply..need to clear the flow of push from you..

1. In Kinvey Console-> Engagement->Push ,under configurations I have added my Sender ID and API Keys..I am getting response message sent 202 Accepted.But I am not getting any notification.


2. I want to know more about custom endpoint. My main doubt is suppose I have written my business logic as 


function onRequest(request, response, modules){

var push = modules.push;

var reqs=request.body;

push.broadcastMessage(reqs);

response.complete();

}


So how kinvey will know to which device it has to send notification? Does it send notification to the device which I have registered using below code?


POST /push/:appKey/register-device HTTP/1.1
Host: baas.kinvey.com
Authorization: [user credentials]
Content-Type: application/json

{
  "platform": "android",
  "deviceId": "device ID goes here"
}



Hi Shweta,


A couple of questions around this:

  1. Which Kinvey Android SDK version are you using? If you aren't on the latest version (2.10.11), you should try with the latest SDK.
  2. Are you making the push registration call from Android application code? Does it complete successfully and execute success callback?
  3. Are you able to confirm the push token in Kinvey console after push registration?
  4. Have you tried to send push notification from Kinvey Console>Engagement>Push? Does it give the same results?


Regards,
Wani
Kinvey Support

Login or Signup to post a comment