{ "id": "162428", "key": "MOD-2280", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10034", "key": "MOD", "name": "Appcelerator Modules", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "17524", "name": "Release 6.0.0", "archived": false, "released": true, "releaseDate": "2016-11-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-08-16T06:45:21.000+0000", "created": "2016-08-05T03:16:19.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:49:34.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": "14521", "name": "Facebook" } ], "description": "h6.Reproduce\r\n1. Run the following code in a simple classic project.\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: \"white\",\r\n});\r\n\r\n// facebook\r\nvar fb = require('facebook');\r\nfb.initialize();\r\nfb.addEventListener('login', function(e) {\r\n if (e.success) {\r\n Ti.API.info('login from uid: '+e.uid+', name: '+ JSON.parse(e.data).name);\r\n checkPermission();\r\n }\r\n else if (e.cancelled) {\r\n alert('cancelled');\r\n }\r\n else {\r\n alert(e.error);\r\n }\r\n});\r\n\r\n// button to tigger facebook authorise and check the permission\r\nvar button = Ti.UI.createButton({\r\n\ttitle:\"Authorise and check the permission\",\r\n\ttop: 100\r\n});\r\nbutton.addEventListener('click',function(e){\r\n\tif (!fb.loggedIn) {\r\n\t\tconsole.log(\"not logged yet.\");\r\n\t\tfb.authorize();\r\n\t} else {\t\r\n\t\tcheckPermission();\r\n\t}\r\n});\r\nwin.add(button);\r\n\r\nfunction checkPermission() {\r\n\tif(fb.permissions.indexOf('publish_actions') < 0) {\r\n\t\tTi.API.info(\"No publish_action permission\");\r\n\t} else {\r\n\t\tTi.API.info(\"Do have publish_action permission\");\r\n\t}\r\n}\r\n\r\nwin.open();\r\n{code}\r\n2. Click the button to login/authorise.\r\n3. Then click it again to check permissions.\r\n\r\nh6.Problem.\r\nApp will cash if you click the button for several times.\r\n\r\nh6.Note\r\nNo any crash log in console.\r\n", "attachment": [], "flagged": false, "summary": "Facebook: fb.permissions leading to crash inconsistently on iOS", "creator": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": "SDK 5.3.1.GA\r\nFacebook 5.2.0\r\niOS 9.3", "closedSprints": [ { "id": 695, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2016-08-13T00:00:16.620Z", "endDate": "2016-08-27T00:00:00.000Z", "completeDate": "2016-08-29T03:18:08.942Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "392561", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can you add `fb.initialize()` before using the module instance? Just some troubleshooting.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-05T23:08:24.000+0000", "updated": "2016-08-05T23:08:24.000+0000" }, { "id": "392575", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I've put it into this sprint for further investigation. Is there a difference between main-thread enabled and disabled? The issue is definitely threading-related and I guess the problem is that we wait for the permissions [here|https://github.com/appcelerator-modules/ti.facebook/blob/master/ios/Classes/FacebookModule.m#L178] which can produce problems when being used in properties that need to return something immediately. I'll update this ticket as soon as I've tested it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-06T09:51:19.000+0000", "updated": "2016-08-06T09:51:19.000+0000" }, { "id": "392614", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator-modules/ti.facebook/pull/60\r\n\r\nOk, so here it what the PR does:\r\n- The getter was forced to run on the main-thread and wait for the result. That caused major problems, since the return value has not been retained. \r\n- I also found out that this was a known issue in the Facebook-SDK, so I updated it to the latest stable available\r\n- While I did that, I also found some memory-leaks across the share-dialogs which I fixed\r\n- I tested the change with both kroll- and main-thread and did a click-penetration with 20+ clicks and no crash (before: crash after 2-3 times visible)\r\n- Finally bumped the version of ti.facebook to 1.2.3", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-08T13:39:33.000+0000", "updated": "2016-08-08T13:39:33.000+0000" }, { "id": "392827", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pre-release: https://github.com/appcelerator-modules/ti.facebook/releases/tag/ios-5.2.3", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-10T07:04:05.000+0000", "updated": "2016-08-10T07:04:05.000+0000" }, { "id": "393244", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel] PR merged. Proceed to have the packaged Facebook module PR into titanium_mobile please.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-08-16T05:12:16.000+0000", "updated": "2016-08-16T05:12:16.000+0000" }, { "id": "393247", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR (titanium_mobile/master): https://github.com/appcelerator/titanium_mobile/pull/8234\r\n\r\nNew ti.facebook iOS version 5.2.3 released.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-16T06:45:15.000+0000", "updated": "2016-08-16T06:45:15.000+0000" }, { "id": "440225", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:34.000+0000", "updated": "2018-08-06T17:49:34.000+0000" } ], "maxResults": 14, "total": 14, "startAt": 0 } } }