[TIMOB-23533] If you have LiveView enabled, then you cannot registerForPushNotifications on iOS
| GitHub Issue | n/a |
| Type | Bug |
| Priority | High |
| Status | Resolved |
| Resolution | Cannot Reproduce |
| Resolution Date | 2017-04-21T04:07:08.000+0000 |
| Affected Version/s | Release 4.0.0 |
| Fix Version/s | Backlog |
| Components | iOS, LiveView |
| Labels | qe-4.0.0, user_experience |
| Reporter | Wilson Luu |
| Assignee | Eric Wieber |
| Created | 2015-05-08T22:50:05.000+0000 |
| Updated | 2017-04-23T21:46:01.000+0000 |
Description
*Details:* If you have LiveView enabled, then you cannot registerForPushNotifications on iOS.
*Note:* To workaround this issue, turn off LiveView.
*Steps to reproduce:*
Make sure you have a valid provisioning profile for iOS push
Create a Titanium app with services enabled
On platform.appcelerator.com, make sure to setup iOS push
Next, download, unzip, and copy contents of Archive.zip into Titanium Resources directory
Enable LiveView
Install app to device
Once the app is launched, go to *Push Notifications > Settings for This Device*
Click the *Disabled* button to *Enable* push notification
*Actual:* Device token is not retrieved i.e. Ti.Network.registerForPushNotifications is not registering the success callback; go to Resources/windows/pushNotifications/pushManager.js and see line 76.
*Expected:* Device token should be retrieved from ACS; see attachment.
Attachments
If for whatever reason this is not fixable - we should provide some messaging to the developer if at all possible that they are trying to register push notifications with liveView enabled and there is a known conflict.
Simple Use case :
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); win.open(); Ti.App.iOS.addEventListener('usernotificationsettings', e = function(v) { console.log("In usernotificationsettings: " + JSON.stringify(v)); Ti.App.iOS.removeEventListener('usernotificationsettings', e); Ti.Network.registerForPushNotifications({ success: onSuccess, error: deviceTokenError, callback: receivePush }); }); 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 ] }); var onSuccess = function(e) { Ti.API.info("TOKEN: " + e.deviceToken); alert('Device token is retrieved: ' + e.deviceToken); // do stuff }; var receivePush = function(e) { Ti.API.info('Received push: ' + JSON.stringify(e)); }; var deviceTokenError = function(e) { Ti.API.info('Failed to register for push notifications! ' + e.error); };I verified on 6.1.0 and 6.2.0 , it is working fine. It is not working before 6.1.0. [~ewieber] Can you please verify and close it.