As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Hi,
I am back on this problem.
I have found that when my server sends a push my business logic runs but nothing goes to the device.
I found that when I send a push from the Engagement consols it makes it to the device.
So, that tells me there is probably something not right in my business code.
This is my code:
function onRequest(request, response, modules){ var push = modules.push, collectionAccess = modules.collectionAccess; var logger = modules.logger; var iOSAps = { alert: request.body.message, badge: parseInt(request.body.count), sound: "default.wav" }; var iOSExtras = ''; var androidPayload = {message: request.body.message }; collectionAccess.collection('user').findOne({ "_id": collectionAccess.objectID(request.body.KinveyID) }, function(err, user) { if (user) { push.sendPayload(user, iOSAps, iOSExtras, androidPayload); } response.complete(); }); }
Hello Gary, i seem to have the exact same problem. Notifications do work from the console but business logic does not reach device although it says that it was sent.
I have tried adding a callback but it still doesn't seem to work, but i discovered that SendMessage does work in business logic with or without the callback, except sendPayload won't work at all.
Kinvey, maybe you need to change your documentation. This link you provided says:
Push calls are asynchronous in nature. They can be invoked without a
callback, but are not guarunteed to complete before continuing to the
next statement. However, __once invoked they will complete the sending of
the push messages, even if the business logic is terminated via
response.complete, response.continue, or response.error.__
I also tried adding the call back as indicated.
No difference.
function onRequest(request, response, modules){ var push = modules.push, collectionAccess = modules.collectionAccess; var logger = modules.logger; var iOSAps = { alert: request.body.message, badge: parseInt(request.body.count), sound: "default.wav" }; var iOSExtras = ''; var androidPayload = {message: request.body.message }; collectionAccess.collection('user').findOne({ "_id": collectionAccess.objectID(request.body.KinveyID) }, function(err, user) { if (user) { push.sendPayload(user, iOSAps, iOSExtras, androidPayload, function(err, result) { response.continue(); }); } }); }
Gary W
I received this from a customer.
I am wondering is this is in some way related to my endpoint setup?
The code is below
Gary
---
I've been playing with the notifications a little bit on my iphone and ipad, and have found the following things:
1. Prior to upgrading my iphone to iOS 8 notifications on my iphone and ipad worked the same way
2. After upgrading my iphone to iOS 8 I receive banner alerts, but badge counts no longer display on my iphone. My ipad which is still running iOS 7 still receives both banners and badge counts. I have the same alert settings on both devices.
3. On my iphone the banner alerts now sometimes "stick" to the top of the screen. For example if I am in the mail app and a banner comes in swiping up to clear it does not work, but it does work if I'm just on the home screen.
---
`function onRequest(request, response, modules){
var push = modules.push, collectionAccess = modules.collectionAccess;
var iOSAps = { alert: request.body.message, badge: parseInt(request.body.count), sound: "default.wav" };
var iOSExtras = '';
var androidPayload = {message: request.body.message };
collectionAccess.collection('user').findOne({ "_id": collectionAccess.objectID(request.body.KinveyID) }, function(err, user) {
if (user)
{
push.sendPayload(user, iOSAps, iOSExtras, androidPayload);
}
response.complete();
});
}`