Hey dennis,
i’m currently receiving the notificaion on my app cause i read this everytime i send the notification from my node.js app:
02-11 02:56:11.461 1552-4757/co.poynt.cloudmessaging D//PcmWebSocketClient.java:64: ReadingThread WEBSOCKET got: {“deviceId”:“urn:tid:4f92fb19-5be6-3d98-8ec0-aa7001aa8fa0”,“serialNum”:“P6SW188JS001130”,“type”:“co.poynt.api.model.CloudMessage”,“body”:"{“recipient”:{“packageName”:“com.example.alex.livehelppoynt”,“className”:“MyBroadcastReceiver”},“ttl”:5000,“id”:“urn:tid:4f92fb19-5be6-3d98-8ec0-aa7001aa8fa0-111”,“data”:“bellissimo3”,“deviceId”:“urn:tid:4f92fb19-5be6-3d98-8ec0-aa7001aa8fa0”,“serialNum”:“P6SW188JS001130”,“sender”:“urn:aid:4d02cdb2-dcae-451b-b314-07e0a8ace1a8”,“businessId”:“435ba9ad-57bf-445f-87fa-a0c21df9499d”,“storeId”:“1f7b06ed-2325-4aaf-b4fe-3b5c03e1bc9d”}",“businessId”:“435ba9ad-57bf-445f-87fa-a0c21df9499d”,“storeId”:“1f7b06ed-2325-4aaf-b4fe-3b5c03e1bc9d”}
The problem is that my broadcast receiver is never triggered. Any idea why?
This is my code:
public class MyBroadcastReceiver extends BroadcastReceiver {
public MyBroadcastReceiver() { }
@Override
public void onReceive(Context context, Intent intent) {
Log.d("MyBroadcastReceiver", "Got cloud Message: " + intent.getStringExtra(Intents
.INTENT_EXTRA_CLOUD_MESSAGE_BODY));
}
}
poynt.sendCloudMessage({
businessId : ‘435ba9ad-57bf-445f-87fa-a0c21df9499d’,
storeId : ‘1f7b06ed-2325-4aaf-b4fe-3b5c03e1bc9d’,
deviceId : ‘urn:tid:4f92fb19-5be6-3d98-8ec0-aa7001aa8fa0’,
recipientClassName : ‘MyBroadcastReceiver’,
recipientPackageName : ‘com.example.alex.livehelppoynt’,
data : msg,
ttl : ‘5000’
}, function (err, doc, http) {
if (err) {
res.send(err);
console.log(err);
}
var my_response = JSON.stringify(doc);
console.log(my_response);
res.send("Sent!");
});
Best regards,
Andrea