Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2064] No success or error callbacks after registering for push notifications on iOS

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2013-04-04T23:24:51.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Titanium SDK & CLI
LabelsAPNS, Notifications, Push, ios
ReporterTim Keir
AssigneeMostafizur Rahman
Created2013-03-04T02:27:42.000+0000
Updated2016-03-08T07:41:01.000+0000

Description

I'm unable to receive any callbacks (not success nor error) when registering an iOS device for Push Notifications within Titanium Mobile. I've generated my Development and Production Push SSL Certificates within iOS Provisioning Portal. The App ID doesn't use a wildcard. I'm testing on physical devices and not the Simulator. When calling Ti.Network.registerForPushNotifications() I'm successfully seeing the Allow/Deny alert prompt however when clicking Allow I see no Success or Error callbacks fired. This of course means I can't obtain the deviceToken! Clicking Allow successfully adds the app under the Notifications section of Settings of course without the deviceToken that's useless.
Ti.Network.registerForPushNotifications({
    types: [Ti.Network.NOTIFICATION_TYPE_BADGE,
        Ti.Network.NOTIFICATION_TYPE_ALERT,
        Ti.Network.NOTIFICATION_TYPE_SOUND],
    success: function(e) {
        Ti.API.info("PUSH SUCCESS: token = "+e.deviceToken);
        var deviceToken = e.deviceToken;
    },
    error: function(e) {
        Ti.API.info("PUSH FAILED");
    },
    callback: function(e) {
        // Ignoring for now...
    }
});

Comments

  1. Tim Keir 2013-04-08

    For future reference this occurs when the required ports are closed behind a Firewall. Specifically port 5223. More info here: http://support.apple.com/kb/TS4264?viewlocale=en_US This is most likely to occur when testing on WiFi only iPads as iOS will opt to use a Cellular Data Connection when available to bypass such issues (even when connected to Wifi). You should probably update the documentation to reflect this as there's currently no feedback indicating this. http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network

JSON Source