{ "id": "117634", "key": "TIMOB-14666", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-07-26T09:14:36.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "supportTeam" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" }, { "id": "15856", "description": "Release 3.2.1", "name": "Release 3.2.1", "archived": false, "released": true, "releaseDate": "2014-02-10" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:42.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h2. Problem description\r\nWhen sending a push notification to the device, if the payload contains the icon and the file is not available, or the icon is not specified, the documentation states the default app icon would be used. However, instead of the app icon's, an \"information\" image is shown instead.\r\n\r\nh2. Steps to reproduce\r\nJust send a notification to the Android device, with the icon in the Payload. If the icon is not specified, or it does not exist, the wrong icon is shown.\r\n\r\nh2. Additional information\r\nThe documentation says the app icon is used: http://docs.appcelerator.com/cloud/latest/#!/guide/android-section-7\r\n\r\n\"If no icon is provided or the provided one is unreachable, the app's icon will be used by default.\"\r\n\r\nh2. Code to reproduce the issue\r\nI used the following code to get the notifications and test this. To send a notification, I use the dashboard.\r\n\r\n{code}\r\n(function() {\r\n\tvar platform = null;\r\n\tvar type = null;\r\n\tvar deviceToken = null;\r\n\tvar username = null;\r\n \r\n\tvar label = null;\r\n \r\n\t// Cloud modules\r\n\tvar CloudPush = null; // required for Android\r\n\tvar Cloud = require('ti.cloud');\r\n \r\n\tfunction init() {\r\n\t\tplatform = Ti.Platform.osname;\r\n\t\ttype = platform;\r\n \r\n\t\tswitch(platform) {\r\n\t\t\tcase \"iphone\":\r\n\t\t\tcase \"ipad\":\r\n\t\t\t\ttype = \"ios\";\r\n\t\t\t\tbuildUI();\r\n\t\t\t\tbreak;\r\n \r\n\t\t\tcase \"android\":\r\n\t\t\t\tCloudPush = require(\"ti.cloudpush\");\r\n\t\t\t\tCloudPush.debug = true;\r\n \r\n\t\t\t\tbuildUI();\r\n\t\t\t\tbreak;\r\n \r\n\t\t\tdefault:\r\n\t\t\t\tshowError(\"Platform not supported!\");\r\n\t\t}\r\n\t}\r\n \r\n\tfunction buildUI() {\r\n\t\tvar win = Ti.UI.createWindow({\r\n\t\t backgroundColor : 'black',\r\n\t\t layout: 'vertical'\r\n\t\t});\r\n \r\n\t\tvar title = Ti.UI.createLabel({\r\n\t\t\ttext: \"Appcelerator Cloud Services\",\r\n\t\t\tfont: {\r\n\t\t\t\tfontSize: \"20dp\"\r\n\t\t\t},\r\n\t\t\tcolor: \"white\",\r\n\t\t\ttop: \"10dp\",\r\n\t\t\theight: Ti.UI.SIZE\r\n\t\t})\r\n \r\n\t\twin.add(title);\r\n \r\n\t\tvar btn = Ti.UI.createButton({\r\n\t\t\ttitle: \"Subscribe\",\r\n\t\t\theight: Ti.UI.SIZE,\r\n\t\t\ttop: '10dp'\r\n\t\t});\r\n \r\n\t\tbtn.addEventListener('click', function(e) {\r\n\t\t\tlabel.text = \"\";\r\n \r\n\t\t\t// login the default user\r\n\t\t\tcheckUser();\r\n\t\t});\r\n \r\n\t\twin.add(btn);\r\n \r\n\t\tlabel = Ti.UI.createLabel({\r\n\t\t\ttext: \"\",\r\n\t\t\twidth: Ti.UI.FILL,\r\n\t\t\theight: Ti.UI.FILL,\r\n\t\t\tcolor: \"#dddddd\",\r\n\t\t\ttop: '10dp'\r\n\t\t});\r\n \r\n\t\twin.add(label);\r\n \r\n\t\twin.open();\r\n\t}\r\n \r\n\tfunction checkUser(retrying) {\r\n\t\tCloud.Users.logout(function (e) {\r\n\t \tusername = Ti.App.Properties.getString('username');\r\n\t\t\tif(username) {\r\n\t\t\t\tloginUser(retrying);\r\n\t\t\t} else {\r\n\t\t\t\tusername = \"\";\r\n\t\t\t\tfor(var i=0; i<10; i++) {\r\n\t\t\t\t\tusername += (\"\" + Math.floor(10 * Math.random()));\r\n\t\t\t\t}\r\n \r\n\t\t\t\taddLog(\"Registering user \" + username + \"...\");\r\n\t\t\t\tCloud.Users.create({\r\n\t\t\t\t\tusername: username,\r\n\t\t\t password: 'logmein',\r\n\t\t\t password_confirmation: 'logmein'\r\n\t\t\t }, function (e) {\r\n\t\t\t if (e.success) {\r\n\t\t\t addLog(\"User registered.\");\r\n\t\t\t Ti.App.Properties.setString('username', username);\r\n\t\t\t loginUser(retrying);\r\n\t\t\t } else {\r\n\t\t\t showError(e);\r\n\t\t\t }\r\n\t\t\t });\r\n\t\t\t} \r\n\t });\r\n\t}\r\n \r\n\tfunction loginUser(retrying) {\r\n\t\taddLog(\"Logging in as \" + username + \"...\");\r\n\t\tCloud.Users.login({\r\n login : username,\r\n password : 'logmein'\r\n }, function(e) {\r\n if (e.success) {\r\n \taddLog(\"Logged in as \" + username + \".\");\r\n getDeviceToken();\r\n } else {\r\n \tif(retrying) {\r\n \t\tshowError(e);\r\n \t} else {\r\n\t // try recreating the user\r\n\t Ti.App.Properties.setString('username', null);\r\n\t checkUser(true);\r\n\t }\r\n }\r\n });\r\n\t}\r\n \r\n\tfunction getDeviceToken() {\r\n\t\tswitch(type) {\r\n\t\tcase \"android\":\r\n\t\t\tCloudPush.retrieveDeviceToken({\r\n\t\t\t success : registrationSuccess,\r\n\t\t\t error : showError\r\n\t\t\t});\r\n\t\t\tbreak;\r\n \r\n\t\tcase \"ios\":\r\n\t\t\tTitanium.Network.registerForPushNotifications({\r\n\t\t\t\ttypes: [\r\n\t\t\t\t\tTitanium.Network.NOTIFICATION_TYPE_ALERT\r\n\t\t\t\t],\r\n \r\n\t\t\t\tsuccess: registrationSuccess,\r\n\t\t\t\terror: showError,\r\n\t\t\t\tcallback: handleNotification\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n \r\n\tfunction defaultUnsubscribe() {\r\n\t\tCloud.PushNotifications.unsubscribe({\r\n\t\t\tdevice_token: deviceToken\r\n\t\t}, function(e) {\r\n\t\t\tdefaultSubscribe();\r\n\t\t});\r\n\t}\r\n \r\n\tfunction defaultSubscribe() {\r\n\t\tCloud.PushNotifications.subscribe({\r\n\t\t\tchannel: 'alert',\r\n\t\t\ttype: type,\r\n\t\t\tdevice_token: deviceToken\r\n\t\t},\r\n\t\t\tfunction (e) {\r\n\t\t\t\tif (e.success) {\r\n\t\t\t\t\taddLog(\"Subscribed to the alert channel\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\taddLog(\"Already subscribed to the alert channel\");\r\n\t\t\t\t}\r\n \r\n\t\t\t\taddLog(\"Ready to receive notifications\");\r\n\t\t\t});\r\n \r\n\t\tswitch(type) {\r\n\t\tcase \"android\":\r\n\t\t CloudPush.addEventListener('callback', function(e) {\r\n\t\t\t handleNotification(e);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n \r\n\tfunction registrationSuccess(e) {\r\n\t\tdeviceToken = e.deviceToken;\r\n\t\taddLog(\"Got device token: \" + deviceToken);\r\n \r\n\t\tif(platform == \"android\") {\r\n\t\t\tCloudPush.enabled = true;\r\n\t\t}\r\n \r\n\t\tdefaultUnsubscribe();\r\n\t}\r\n \r\n\tfunction showError(e) {\r\n\t\talert('Error: ' + ((e.error && e.message) || JSON.stringify(e)));\r\n\t}\r\n \r\n\tfunction handleNotification(e) {\r\n\t\taddLog(\"Notification received\");\r\n\t\tif(e && e.payload && e.payload.alert) {\r\n\t\t\talert(e.payload.alert);\r\n\t\t} else {\r\n\t\t\talert(JSON.stringify(e));\r\n\t\t}\r\n\t}\r\n \r\n\tfunction addLog(text) {\r\n\t\tlabel.text = label.text + \"\\n\" + text;\r\n\t}\r\n \r\n\tinit();\r\n})();\r\n{code}", "attachment": [ { "id": "45991", "filename": "device-2014-02-18-134423.png", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2014-02-18T07:46:56.000+0000", "size": 35747, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: push notification icon does not show the default icon if the chosen one is missing", "creator": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Android 4.2", "comment": { "comments": [ { "id": "296738", "author": { "name": "mavno", "key": "mavno", "displayName": "Martin N", "active": true, "timeZone": "Europe/Berlin" }, "body": "This also affects 3.2.2. Doesn't show the default icon/appicon, when \"icon\" is not specified.", "updateAuthor": { "name": "mavno", "key": "mavno", "displayName": "Martin N", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-03-12T07:44:15.000+0000", "updated": "2014-03-12T07:44:15.000+0000" }, { "id": "357138", "author": { "name": "manuellehner", "key": "manuellehner", "displayName": "Manuel Lehner", "active": true, "timeZone": "Europe/Berlin" }, "body": "Please open source ti.cloudpush - would like to help here", "updateAuthor": { "name": "manuellehner", "key": "manuellehner", "displayName": "Manuel Lehner", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-07-07T11:48:15.000+0000", "updated": "2015-07-07T11:48:15.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }