{ "id": "138089", "key": "TIMOB-18276", "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": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-11-28T23:37:21.000+0000", "created": "2014-10-15T09:29:00.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "TCSupport", "android", "notification" ], "versions": [ { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" }, { "id": "16676", "description": "Release 3.4.1", "name": "Release 3.4.1", "archived": false, "released": true, "releaseDate": "2014-11-14" } ], "issuelinks": [], "assignee": { "name": "fmerzadyan-OLD", "key": "fmerzadyan", "displayName": "Farzad Merzadyan", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-11-29T22:41:25.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nI am unable to dynamically set a Notification (toast) \"message\" attribute using the setting method \"setMessage\" from my controller. When called I get:\r\n\r\n\"Object # has no method 'setMessage'\"\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile project (Classic Titanium)\r\n2. Add this code into app.js:\r\n{code}\r\nvar toast = Ti.UI.createNotification({\r\n //message:\"Please Stand By\",\r\n duration: Ti.UI.NOTIFICATION_DURATION_LONG\r\n});\r\n\r\ntoast.setMessage = \"Please Stand By\";\r\ntoast.show();\r\n{code}\r\n3. Run it into device. \r\n\r\nh4. Expected results\r\nThe toast showing. \r\n\r\nh4. Actual Results\r\n\r\nWhen called I get:\r\n\r\n\"Object # has no method 'setMessage'\"\r\n\r\n\r\n\r\nh4. Extra info (Workaround)\r\nPutting \"toast.setMessage = \"Please Stand By\";\" or \"toast.message = \"Please Stand By\";\" dynamically, shows notification with blank message. The workaround is to set the message when it is created.\r\n\r\n", "attachment": [], "flagged": false, "summary": "UI.Notification.setMessage function is not found even though it is documented", "creator": { "name": "danr1979", "key": "danr1979", "displayName": "Dan Roberts", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "danr1979", "key": "danr1979", "displayName": "Dan Roberts", "active": true, "timeZone": "Europe/London" }, "environment": "Android app using Titanium SDK 3.4.0.201409261227-26092014122818 on Windows 7, testing on a HTC One device. My Titanium Studio build info is: Titanium Studio, build: 3.4.0.201409261227 Build: jenkins-titanium-rcp-master-197 (origin/master) Date: 26 September 2014, 12:28:18\r\nMobile SDK 3.4.1\r\nAndroid 4.4.x", "closedSprints": [ { "id": 758, "state": "closed", "name": "2016 Sprint 24 SDK", "startDate": "2016-11-19T01:32:06.991Z", "endDate": "2016-12-03T01:32:00.000Z", "completeDate": "2016-12-05T01:53:38.311Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "401722", "author": { "name": "iwhitfield", "key": "iwhitfield", "displayName": "Isaac Whitfield", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This was brought up on Slack and it appears to be an invalid ticket.\r\n\r\n{{setMessage}} is a function, and should therefore be invoked as {{toast.setMessage(\"Please Stand By\")}}. You are overwriting the function definition itself, which will not do anything to affect the notification. Once this code block has executed, {{setMessage}} is then a String, which means calls to it as a function will error giving you the same message you cited. \r\n\r\nAlternatively, you could have used {{toast.message = \"Please Stand By\"}} instead.", "updateAuthor": { "name": "iwhitfield", "key": "iwhitfield", "displayName": "Isaac Whitfield", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-22T23:42:23.000+0000", "updated": "2016-11-22T23:42:23.000+0000" }, { "id": "401736", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~iwhitfield] So your suggested usage does work? I'm wondering if the author just misspelled it. *EDIT*: If not, [this commit|https://github.com/appcelerator/titanium_mobile/compare/master...hansemannn:TIMOB-18276?expand=1#diff-577d9a684b3bdafb1dd7a4cfdafbd0af] might solve it. [~fmerzadyan] thoughts?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-23T04:39:13.000+0000", "updated": "2016-11-23T04:47:03.000+0000" }, { "id": "402224", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n{{setMessage}} works as expected.\r\n\r\nAppc Studio : 4.8.0.201611121409\r\nSDK Version : 6.1.0.v20161129071600\r\nMac OS Version : 10.12\r\nXcode Version : Xcode 8.1 Build version 8B62\r\nAppc CLI AND Appc NPM : {\"NPM\":\"4.2.9-1\",\"CLI\":\"6.0.0\"}\r\nTi CLI : 5.0.10\r\nAlloy : 1.9.4\r\nNode : v4.6.0\r\nGoogle Nexus 6P - 6.0.0", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-11-29T22:41:10.000+0000", "updated": "2016-11-29T22:41:10.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }