Link to home
Start Free TrialLog in
Avatar of Gary4
Gary4Flag for United States of America

asked on

kinvey Push not working for iOS

Hi,

I am not getting any help in the kinvey forums.

Our app is in production and stopped working.

This is my business logic:

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 };
    logger.info('hi');
    collectionAccess.collection('user').findOne({ "_id": collectionAccess.objectID(request.body.KinveyID) }, function(err, user) {
      if (user)
      {
        logger.info('send push');
        logger.info(user);
    		push.sendPayload(user, iOSAps, iOSExtras, androidPayload, function(err, result) {
            response.continue();
            });
      }
    });
}

Open in new window


From the logging I can see that it is running, but no push is sent when the device is iOS.  The push is sent if the device is Android.

Also, a push is sent if I use the Engagement/Message console.  So I conclude that my certificate is still correct and the connection to UrbanAirship is working.

I am at a loss as to what is wrong in my code.

It is my understanding that Kinvey may have changed something a few months ago.  I have looked at the documentation and my code still looks correct to me.

Gary
SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary4

ASKER

I consider it Delphi related since my app is written in Delphi XE8 and and the pushes are being sent from a Datasnap Server to Kinvey.  And Embarcadro seems to like Kinvery.

Yes I get the logging info.

Here is one from an ios user.

"hi" 2015-07-30T01:19:00-04:00 INFO 
"send push" 2015-07-30T01:19:00-04:00 INFO 
{"_id":"55932803fbbe77e64e0711a8","username":"gwardell-06/30/2015 19-36-35.194","salt":"bd54a7dd-2e5a-4345-8570-47dce04b8581","_kmd":{"lmt":"2015-06-30T23:36:39.882Z","ect":"2015-06-30T23:36:35.415Z"},"_acl":{"creator":"55932803fbbe77e64e0711a8"},"_messaging":{"pushTokens":[{"token":"d1b310c0f71e29ea22ef37b1b9f188101ea474b375642bdde331036733408898","platform":"ios"}]}} 2015-07-30T01:19:00-04:00 INFO 

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary4

ASKER

Yes, well, what I show above is the custom endpoint business logic.

Users are being created so that part works.

Pushes are sent to Android, just not to iOS and there is the problem.  I have no idea why not iOS.  And it used to work until a couple months ago.  And sending from the Kinvey control panel works for both devices so the Urban Airship connection is good and the Apple certificate is good.  That is why I am at a loss.

I am getting rather fed up with Kinvey.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Gary4

ASKER

I have iOS8 on my iPad.  And apple won't let me downgrade.

I think my users that are complaining also have iOS 8.
Avatar of Gary4

ASKER

Hi,

I just want to close this.

We didn't arrive at a solution.  I think it is a Kinvey bug that they aren't admitting to.

Thanks for looking at it and offering comments.