Hi,
First of all, I followed this steps push notifications. You can see the configuration here. Then, I am following all this steps device token but I can't get the device token at all. I am testing on iPhone 6+. I am using this command below to run the app in my device.
appc run -p ios -T device -C <DEVICE_UDID> [-V "<DEVELOPER_CERTIFICATE_NAME>" -P <PROVISIONING_PROFILE_UUID>]This is the code that I am using to test.
Ti.include("util/functions.js"); var deviceToken = null; log("deviceToken: " + deviceToken); log("removeDeviceToken: " + Titanium.Network.remoteDeviceUUID); // Check if the device is running iOS 8 or later 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() { log("register for pushing"); // Remove event listener once registered for push notifications Ti.App.iOS.removeEventListener('usernotificationsettings', registerForPush); Ti.Network.registerForPushNotifications({ success: deviceTokenSuccess, error: deviceTokenError, callback: receivePush }); }); log("Register notification types to use"); // 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 ] }); } // Process incoming push notifications function receivePush(e) { log('Received push: ' + JSON.stringify(e)); } // Save the device token for subsequent API calls function deviceTokenSuccess(e) { log("deviceTokenSuccess"); deviceToken = e.deviceToken; } function deviceTokenError(e) { log('Failed to register for push notifications! ' + e.error); }Finally, here is the log when I run in my iPhone 6+
[INFO] deviceToken: null [INFO] removeDeviceToken: undefined [INFO] Register notification types to use [INFO] register for pushingAnyone has some idea what I am doing wrong or missing. I've been looking for some mistake for a long time but I didn't find.
General Information
Operating System Name = Mac OS X Version = 10.10.4 Architecture = 64bit # CPUs = 4 Memory = 8589934592 Node.js Node.js Version = 0.10.37 npm Version = 2.7.5 Titanium CLI CLI Version = 4.0.1 Titanium SDK SDK Version = 4.1.0.GA Target Platform = iphone