{ "id": "153778", "key": "TIMOB-20131", "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": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2016-11-16T18:48:36.000+0000", "created": "2015-12-11T12:35:21.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios", "liveview" ], "versions": [ { "id": "17532", "name": "Release 5.1.1", "archived": false, "released": true, "releaseDate": "2015-11-24" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-27T20:46:16.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": "10206", "name": "iOS", "description": "iOS Platform" }, { "id": "13600", "name": "LiveView", "description": "Live preview of Titanium apps" }, { "id": "10207", "name": "Tooling" } ], "description": "Running the following code on device fails if liveview is enabled. The result is:\r\n\r\n{code:js}TypeError: undefined is not a function (evaluating 'Ti.UI.iOS.createApplicationShortcuts()'){code}\r\n\r\nRunning with LiveView off works.\r\n\r\n{code:js}\r\nif (OS_IOS && Ti.UI.iOS.forceTouchSupported) {\r\n var appShortcuts = Ti.UI.iOS.createApplicationShortcuts();\r\n\r\n appShortcuts.addDynamicShortcut({\r\n itemtype: \"post_text\",\r\n title: \"Text\",\r\n subtitle: \"Tap to post text\",\r\n icon: Ti.UI.iOS.SHORTCUT_ICON_TYPE_COMPOSE,\r\n userInfo: {\r\n post: {\r\n type: \"text\"\r\n }\r\n }\r\n });\r\n\r\n appShortcuts.addDynamicShortcut({\r\n itemtype: \"post_photo\",\r\n title: \"Photo\",\r\n subtitle: \"Tap to post a photo\",\r\n icon: Ti.UI.iOS.SHORTCUT_ICON_TYPE_CAPTURE_PHOTO,\r\n userInfo: {\r\n post: {\r\n type: \"photo\"\r\n }\r\n }\r\n });\r\n\r\n appShortcuts.addDynamicShortcut({\r\n itemtype: \"post_video\",\r\n title: \"Video\",\r\n subtitle: \"Tap to post a video\",\r\n icon: Ti.UI.iOS.SHORTCUT_ICON_TYPE_CAPTURE_VIDEO,\r\n userInfo: {\r\n post: {\r\n type: \"video\"\r\n }\r\n }\r\n });\r\n}{code}", "attachment": [], "flagged": false, "summary": "iOS: Ti.UI.iOS.ApplicationShortcuts does not work on device with LiveView enabled", "creator": { "name": "jasonkneen", "key": "jasonkneen", "displayName": "Jason Kneen", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "jasonkneen", "key": "jasonkneen", "displayName": "Jason Kneen", "active": true, "timeZone": "Europe/London" }, "environment": null, "closedSprints": [ { "id": 751, "state": "closed", "name": "2016 Sprint 23 Tooling", "startDate": "2016-11-05T00:40:36.428Z", "endDate": "2016-11-19T01:40:00.000Z", "completeDate": "2016-11-28T03:51:25.291Z", "originBoardId": 199 } ], "comment": { "comments": [ { "id": "372687", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Looks like when you've enabled LiveView the define isn't set:\r\nhttps://github.com/appcelerator/titanium_mobile/search?utf8=✓&q=USE_TI_UIIOSAPPLICATIONSHORTCUTS\r\n\r\nWe scan the code here:\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/node_modules/titanium-sdk/lib/jsanalyze.js#L102-L145\r\n\r\nAnd set the defines here:\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L5440\r\n\r\nCould it be that since LiveView replaces the app's {{app.js}} it doesn't find these? Then we'd need to fix this by copying in the original {{app.js}} (as {{_app.js}}) as well with LiveView enabled.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-12-11T13:07:33.000+0000", "updated": "2015-12-11T13:07:33.000+0000" }, { "id": "377329", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~jasonkneen] did you try with our 5.2.0.RC? I tried to reproduce here but I don't see the error.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-19T05:53:38.000+0000", "updated": "2016-02-19T05:53:38.000+0000" }, { "id": "380719", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Just pinged Jason via mail. Maybe the {{}} flag was enabled?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-25T23:15:05.000+0000", "updated": "2016-03-25T23:15:05.000+0000" }, { "id": "383045", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "This happens to Ti.UI.create* apis too, i.e {{Ti.UI.createWindow, Ti.UI.iOS.createNavigationWindow, Ti.UI.createLabel}}\r\n\r\nCreate a classic titanium app, do {{ti build -p ios -T device --liveview}}, launch the app, it fails with similar error:\r\n{code}\r\n[ERROR] Error: invalid method (createTabGroup) passed to UIModule\r\n[ERROR] File: app.js\r\n{code}\r\n\r\nThis seems like a SDK issue. ", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-19T00:11:16.000+0000", "updated": "2016-05-19T07:23:23.000+0000" }, { "id": "386166", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Thanks [~fmiao] this is a good reproducible case.\r\nThe problem lies where the command call has to include the flag --deploy-type development in order for this to work, because by default, if you target device, it's --deploy-type test\r\nI'm not sure if this was by design but leaving a note here first until we decide the best approach to fixing this.\r\n\r\nAlso, if you do this in studio, the flag is --deploy-type development so there won't be an issue.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-05-19T07:22:43.000+0000", "updated": "2016-05-19T07:27:31.000+0000" }, { "id": "397852", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "So this is device-only? I know that we include [all defines|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/defines.h] when running a sim-build and generate the symbols manually for device-builds (see _build.js above). So if this issue affects all {{Ti.UI}} namespaces, I'm wondering how this ever worked before then. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-02T16:38:25.000+0000", "updated": "2016-10-02T16:38:25.000+0000" }, { "id": "401211", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Just tested with 6.0.0.GA and I'm not able to reproduce this issue anymore. To be validated by the QE team. Thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-11-16T18:48:36.000+0000", "updated": "2016-11-16T18:48:36.000+0000" }, { "id": "415930", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced, with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-27T20:46:16.000+0000", "updated": "2017-03-27T20:46:16.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }