Start a new topic

iOS Push Notifications with Titanium SDK

I am trying to implement push notifications with the Kinvey Titanium SDK for iOS only (currently). I have gone through the console configuration from the iOS guide. The Kinvey push console shows that iOS Configuration is "Active", so I believe everything is configured correctly there.

In the app, I am using the following method to test registration:

registerDeviceWithPush: function() {

var request = Titanium.Network.createHTTPClient({

timeout : 10000 /* in milliseconds */

});'POST', '' + Kinvey.API_ENDPOINT + '/push/my_actual_app_id/register-device');

request.onerror = function(e) {



request.onload = function(e) {



request.setRequestHeader('Authorization', 'Kinvey ' + Kinvey.getActiveUser()._kmd.authtoken);

request.setRequestHeader('Content-Type', 'application/json');


'platform': 'ios',




I call this method in Kinvey.init() success function, and after verifying Kinvey.getActiveUser exists.

I am getting the following response from both the simulator and on and actual iPhone:

"{"type":"error","source":{"cache":false},"code":500,"error":"HTTP error","success":false}"

Can you help me identify what I'm doing wrong?

Thank you in advance,


Hey Jack, I tagged this under JS since it's with Titanium.
The `deviceId` for push does not equal ``. You’ll need to obtain an actual device token for push. On Titanium, you’ll have to use the `Ti.Network.registerForPushNotification` method. See [here](!/api/Titanium.Network-method-registerForPushNotifications) and [here]( You can then use the obtained device id to register for push with Kinvey.

( By the way, note that testing push on the iOS simular is not possible, you’ll have to use a real device. )
I was able to register my device, but now I am unsure of how to receive the notification? I have implemented the "callback" method of the Titanium.Network.registerForPushNotifications per the instructions you provided, however sending a push from the console is not doing anything. I have verified the registered user has the _push property and it appears to be the correct device ID.

For reference, here is the registerForPushNotifications (where I call the Kinvey registration method in the success callback).


types: [







var deviceToken = e.deviceToken;

//Device token is made available to the next method and I am getting a success response from the Kinvey registration





alert("Error during registration: "+e.error);




// called when a push notification is received.

alert("Received a push notification\n\nPayload:\n\n"+JSON.stringify(e));




Since the user has the `_push` property, my first guess would be there might be something wrong with the push set-up in the console.

Did you follow the steps outlined [here]( It links to the PhoneGap guide, but the iOS instructions should be the same. Make sure you use the right push certificate, i.e. the production push certificate only works if your app is in the App Store, use the development certificate otherwise.
Login or Signup to post a comment