Mac OS X 10.10.3 Titanium SDK 3.5.1 iOS 8.3
Spent the last few days trying to get this working so any help with this would hugely appreciated, sorry about the essay but wanted to be as detailed as possible.
I'm migrating push notifications from Urban Airship to ACS and I have run into issues on iOS. I have successfully setup the push notifications for Android so ACS is sending push notifications but I've been unable to receive any push notifications on at least 2 iOS device both running iOS 8. I haven't got an iOS 7 device to test unfortunately so unsure if this works.
Before using ACS for push notifications on our live apps I have been attempting to set up the push notification functionality on our beta apps. Were using the Apple Ad Hoc feature for this and have the APN Certs setup as production certs which have been added to ACS console in the production environment. We haven't moved to the new ACS platform yet, I was attempting to get this working on https://cloud.appcelerator.com/ first before I migrated everything before the June deadline.
I tried to use my existing Distribution Certs, Provisioning Profiles and APN Cert which was used on Urband Airshup but these didn't work so I created a new Distribution Certificate, APN Cert and Provisioning Profile hoping to sort the issue but this didn't work either
I have used the code found here to register a user account and get the device token.
I can successfully receive a device token and this shows up in the web console in the push section stating 'You currently have 2 iOS clients subscribed to push notifications' so the device is being registered.
I've tried to get it working in the app I am migrating and a test app found here there is a tutorial with it. I amended the code in this slight as shown below to add in the code for iOS8 but still nothing.
function getDeviceToken(){ if (Ti.Platform.name == "iPhone OS" && parseInt(Ti.Platform.version.split(".")[0]) >= 8) { // Wait for user settings to be registered before registering for push notifications Ti.App.iOS.addEventListener('usernotificationsettings', function registerForPush() { // Remove event listener once registered for push notifications Ti.App.iOS.removeEventListener('usernotificationsettings', registerForPush); Ti.Network.registerForPushNotifications({ success: deviceTokenSuccess, error: deviceTokenError, callback: receivePush }); }); // Register notification types to use Ti.App.iOS.registerUserNotificationSettings({ types: [ Ti.App.iOS.USER_NOTIFICATION_TYPE_ALERT, Ti.App.iOS.USER_NOTIFICATION_TYPE_SOUND, Ti.App.iOS.USER_NOTIFICATION_TYPE_BADGE ] }); } // For iOS 7 and earlier else { Titanium.Network.registerForPushNotifications({ types: [ Titanium.Network.NOTIFICATION_TYPE_BADGE, Titanium.Network.NOTIFICATION_TYPE_ALERT, Titanium.Network.NOTIFICATION_TYPE_SOUND ], success: deviceTokenSuccess, error: deviceTokenError, callback: receivePush }); } // Process incoming push notifications function receivePush(e) { alert('Received push: ' + JSON.stringify(e)); } // Enable push notifications for this device // Save the device token for subsequent API calls function deviceTokenSuccess(e) { deviceToken = e.deviceToken; alert("deviceToken = "+deviceToken); subscribeForPush(); } function deviceTokenError(e) { alert('Failed to register for push notifications! ' + e.error); } }The push notification doesn't appear inside or outside the app.
I do receive push notifications from other apps so I am doubtful the phone is the issue and I have checked the settings to make sure push notifications are turned on for both the apps I have tested.
At a loss at the moment.