{ "id": "119742", "key": "TIMOB-15258", "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": "11258", "description": "Holding Pen for Triaged Issues", "name": "Backlog", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-08-27T12:43:57.000+0000", "created": "2013-09-10T10:13:33.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "facebook", "ios", "mobilesdk" ], "versions": [], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-27T17:53:09.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" } ], "description": "Test case:\r\n# login into Facebook using your Titanium's app\r\n# kill it from Dock\r\n# try to open app with Facebook user-to-user request URL from your notifications section in Facebook or newsfeed story. It should be something like fb116843021780929://authorize?...\r\n# \"FBSession: should only be used from a single thread\" red screen appears\r\n\r\nXCode console on a device says:\r\n{code}\r\nSep 10 12:40:08 iPhone Printpie[31305] : *** Assertion failure in -[FBSession handleOpenURL:], /Volumes/Datums/CodeValhalla/Github/Mine/titanium_modules/facebook/mobile/ios/Classes/FBConnect/FBSession.m:426\r\nSep 10 12:40:08 iPhone Printpie[31305] : [ERROR] Script Error FBSession: should only be used from a single thread\r\n{code}\r\n\r\nTest application code is simple as a child's tear:\r\n{code}\r\nvar fb = require('facebook');\r\nfb.appid = '116843021780929';\r\n\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar loginButton = Ti.UI.createButton({\r\n title: 'Login'\r\n});\r\nloginButton.addEventListener('click', function(){fb.authorize();});\r\nwin.add(loginButton);\r\n\r\nwin.open();\r\n{code}\r\n\r\nDon't forget to add into your Info.plist next string for Facebook URL chema support:\r\n{code}\r\n\tCFBundleURLTypes\r\n\t\r\n\t\t\r\n\t\t\tCFBundleURLName\r\n\t\t\tcom.printpie.cleverbug\r\n\t\t\tCFBundleURLSchemes\r\n\t\t\t\r\n\t\t\t\tprintpie\r\n\t\t\t\tfb116843021780929\r\n\t\t\t\r\n\t\t\r\n\t\r\n{code}\r\n\r\nSo:\r\n# run the app\r\n# click \"Login\" button\r\n# login into your Fb account\r\n# you will be bring back to the app\r\n# close simulator\r\n# open simulator stand-alone, without titanium\r\n# try next URL (it's similar as from Facebook native app or Safari's web-version of FB): \r\n{code}fb116843021780929://authorize?expires_in=3600&access_token=qkjKR42UQsewYckYagPhU2Avo4eLruAKH41Vd1u192UORNvhzGftEUi7sOK375opZCKzpK1ZCAyxkBH5je3BUG3E8Shp6mI8VmdXWU2dxrOe4oB7BoDPSAZDZD&target_url=http%3A%2F%2Fm.facebook.com%2Fapps%2Fcleverbug-printpie%3Ffb_source%3Dnotification%26request_ids%3D511072445602499%26ref%3Dnotif%26app_request_type%3Duser_to_user\r\n{code}\r\n# you will see \"FBSession: should only be used from a single thread\"\r\n\r\nI saw many similar questions on Q&A section with no answers :(\r\n\r\nP.S. sorry, no time to make a bundle with test application, but I hope I explained it above.", "attachment": [ { "id": "42342", "filename": "screenshot_2013-09-10_14.10.26.png", "author": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2013-09-10T10:13:33.000+0000", "size": 40052, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Facebook module throws \"FBSession: should only be used from a single thread\" error on reviving app with Facebook request URL", "creator": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "subtasks": [], "reporter": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "environment": "MacOS X 10.8.4\r\nTitanium CLI version 3.1.2, Titanium SDK version 3.1.2.GA\r\niOS SDK: 6.1 and 7.0\r\nXcode 4.6.3 and 5-DP6\r\nTitanium's Facebook module 3.1.1", "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": "270579", "author": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "body": "Probably I know why it happens: old Ti.Facebook module still in SDK, and not requires initialization (with \"require(..\") right? Maybe that is a first thread which is capturing and handle openURL param.", "updateAuthor": { "name": "bobrosoft", "key": "bobrosoft", "displayName": "Vladimir Tolstikov", "active": true, "timeZone": "Europe/Moscow" }, "created": "2013-09-10T16:31:14.000+0000", "updated": "2013-09-10T16:31:14.000+0000" }, { "id": "394558", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This should not happen with Ti.Facebook 5.0.0 and later (e.g. 5.2.3 currently). Resolving for now, please leave your comments if you still see it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-08-27T12:43:58.000+0000", "updated": "2016-08-27T12:43:58.000+0000" }, { "id": "415883", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-27T17:53:09.000+0000", "updated": "2017-03-27T17:53:09.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }