Project: titanium
Issue TIMOB-17945: Android: CloudPush - events not fired correctly
h4. Problem Description If CloudPush.singleCallback is set to true, "callback" event will not be fired when clicking the tray notification that launches the app (app wasn't in the foreground nor the background). Without CloudPush.singleCallback set to true, "callback" will be fired as expected. trayClickFocusedApp and trayClickLaunchedApp are never fired in any case. h4. Testcase 1. Create a new mobile project (classic titanium) 2. Paste this to app.js {code} var CloudPush = require('ti.cloudpush'); CloudPush.retrieveDeviceToken({ success: function deviceTokenSuccess(e) { // Use this device token with Ti.Cloud.PushNotifications calls // to subscribe and unsubscribe to push notification channels Ti.API.info('Device Token: ' + e.deviceToken); }, error: function deviceTokenError(e) { alert('Failed to register for push! ' + e.error); } }); // These events monitor incoming push notifications CloudPush.addEventListener('callback', function (evt) { alert(evt.payload); }); CloudPush.addEventListener('trayClickLaunchedApp', function (evt) { Ti.API.info('Tray Click Launched App (app was not running)'); }); CloudPush.addEventListener('trayClickFocusedApp', function (evt) { Ti.API.info('Tray Click Focused App (app was already running)'); }); {code} 3. Run in device. h4. OBSERVED PROBLEM After Enabling "ti.cloud" and "ti.cloudpush" in the project, we provided the Production and Development Key generated by titanium and also the ACS API key from web console in the "tiapp.xml" file. {code} W4dRrpUDB86lWmDP8xUQvFT8GYSba0Py vLJOUvCtWkNZISxsLJnovTUpsYFpE3BY W4dRrpUDB86lWmDP8xUQvFT8GYSba0Py {code} We also configured the app for GCM protocol. After Running the app. An error message has shown and though GCM Authentication was successful, The Device token was not shown in the console. h4. Error Message {code} [ERROR] : SELinux: Function: selinux_android_load_priority [0], There is no sepolicy file [INFO] : TiApplication: (main) [0,0] checkpoint, app created. [INFO] : TiApplication: (main) [210,210] Titanium 3.3.0 (2014/07/11 12:36 787cd39) [ERROR] : SELinux: [ERROR] : SELinux: Function: selinux_android_load_priority [1], There is no sepolicy version file [ERROR] : SELinux: [ERROR] : SELinux: selinux_android_seapp_context_reload: seapp_contexts file is loaded from /seapp_contexts {code}
Story points: 21