{ "id": "110051", "key": "TIMOB-12828", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15274", "description": "2013 Sprint 06 API", "name": "2013 Sprint 06 API", "archived": true, "released": true, "releaseDate": "2013-03-25" }, { "id": "14816", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-22T23:54:21.000+0000", "created": "2013-02-22T21:53:59.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "kicthensink", "parity", "qe-devCheck" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-10-03T23:17:59.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": "REPRODUCTION:\r\nFirst, run the code below using 3.0.2 GA to see the previous behavior in the iOS simulator. Click login. Notice the dialog box appears. Enter your credentials. Then, click the logout button.\r\n\r\nNext, \r\n# Comment out line 1 and uncomment line 2, so you are using the add-on module.\r\n# Change the SDK version to 3.1.0\r\n# Add the facebook module and add this item in the tiapp.xml: 495338853813822\r\n# Run the code again on the iOS simulator. See results below for findings.\r\n\r\nRESULTS:\r\n1. When clicking the login button, the application opens Safari to enter your credentials instead of the dialog as in the previous version.\r\n2. When clicking the logout button, the application throws this error:\r\n\r\n{noformat}\r\n[INFO] : \b\b \b 2013-02-22 13:47:19.369 FacebookTest[87247:22503] *** Assertion failure in -[FBSession close], /Volumes/Datums/CodeValhalla/Github/Mine/titanium_modules/facebook/mobile/ios/Classes/FBConnect/FBSession.m:404\r\n[ERROR] : \b\b \bScript Error {\r\n[TRACE] : \b\b \b= \"#0 () at :0\";\r\n[TRACE] : \b\b \b line = 25;\r\n[TRACE] : \b\b \b message = \"FBSession: should only be used from a single thread\";\r\n[TRACE] : \b\b \b sourceId = 275184000;\r\n[TRACE] : \b\b \b sourceURL = \"file://localhost/Users/bhatfield/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/DF408B6A-B022-4CB8-B834-A527FD542DD0/FacebookTest.app/app.js\";\r\n[TRACE] : \b\b \b}\r\n{noformat}\r\n\r\nNOTES:\r\nWith the Facebook.LoginButton, when logging in, the application still opens a Safari window to enter your credentials, but you can logout OK. No error is thrown.\r\n\r\nOn Android, the default login process behaves the same (dialog appears in both cases) and the application can logout OK.\r\n\r\nFURTHER QUESTION:\r\nI don't know if this is a parity issue or not, but when logging out in iOS, you can login again without supplying your credentials. On Android, if you logout, you have to supply your credentials again when you login.\r\n\r\nTEST CODE:\r\n{code}\r\nvar fb = Ti.Facebook;\r\n//var fb = require('facebook');\r\nfb.appid = 495338853813822;\r\nfb.permissions = ['publish_stream','create_event'];\r\nfb.addEventListener('login', function(e) {\r\n if (e.success) {\r\n alert('Logged In');\r\n } else if (e.error) {\r\n alert(e.error);\r\n } else if (e.cancelled) {\r\n alert(\"Canceled\");\r\n }\r\n});\r\nfb.addEventListener('logout', function(e) {\r\n alert('Logged Out');\r\n});\r\n\r\nvar login = Ti.UI.createButton({title: 'Login'});\r\nlogin.addEventListener('click', function(e){\r\n\tfb.authorize();\r\n});\r\n\r\nvar logout = Ti.UI.createButton({title: 'Log Out'});\r\nlogout.addEventListener('click', function(e){\r\n\tfb.logout();\r\n});\r\n\r\nvar win = Ti.UI.createWindow({layout: 'vertical', backgroundColor: 'white'});\r\nwin.add(login);\r\nwin.add(logout);\r\nwin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Facebook v3 Module: Login process differs from Ti.Facebook and logout fails", "creator": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Mac OSX 10.7.5\r\nTiStudio 3.0.2\r\nTiSDK 3.0.2.GA for Ti.Facebook\r\nTiSDK 3.1.0 (02/21/13 13:52 a850c18) for Facebook v3 modules\r\nxCode 4.5.1 / iOS 6 Simulator\r\nfacebook-iphone-3.1.0.zip\r\nAndroid 4.2\r\nfacebook-android-3.0.0.zip\r\n", "comment": { "comments": [ { "id": "239473", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Found some new information. Investigating.", "updateAuthor": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-22T23:11:53.000+0000", "updated": "2013-02-22T23:11:53.000+0000" }, { "id": "239478", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Tried changing the initial permissions and forceDialogAuth settings. logout method still fails.\n\n{code}\nfb.permissions = ['read_stream'];\nfb.forceDialogAuth = false;\n{code}", "updateAuthor": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-22T23:48:04.000+0000", "updated": "2013-02-22T23:48:04.000+0000" }, { "id": "240921", "author": { "name": "omri@matchspotapp.com", "key": "omri@matchspotapp.com", "displayName": "Omri Shaked", "active": true, "timeZone": "Asia/Gaza" }, "body": "To fix the logout bug, change some code in FacebookModule.m:\r\n\r\nThe logout function looks like this:\r\n{code}\r\n-(void)logout:(id)args\r\n{\r\n\tVerboseLog(@\"[DEBUG] facebook logout\");\r\n\tif ([self isLoggedIn])\r\n\t{\r\n\t\t[facebook logout:self];\r\n\t}\r\n}\r\n{code}\r\n\r\nWhile it should look like this: (run only on main thread)\r\n{code}\r\n-(void)logout:(id)args\r\n{\r\n\tVerboseLog(@\"[DEBUG] facebook logout\");\r\n\tif ([self isLoggedIn])\r\n\t{\r\n TiThreadPerformOnMainThread(^{\r\n [facebook logout:self];\r\n }, NO);\r\n\t}\r\n}\r\n{code}\r\n\r\nHappens on iOS 6.1 / 6.1.2 with SDK 3.0.0GA, modified to use the new 3.1 Facebook SDK instead of the internal Facebook module of 3.0.0.GA.\r\n\r\nAlso, the issue's severity should be changed, since this bug WILL be a major one in the 3.1 release.", "updateAuthor": { "name": "omri@matchspotapp.com", "key": "omri@matchspotapp.com", "displayName": "Omri Shaked", "active": true, "timeZone": "Asia/Gaza" }, "created": "2013-03-06T09:32:18.000+0000", "updated": "2013-03-06T09:32:18.000+0000" }, { "id": "242335", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Good catch in needing to wrap logout on the main thread. The only bit remains is: the behavior change was not caused by a codechange in Titanium, but appears to be a change within Facebook's own SDK code. Perhaps this is intentional on their part; after all, for iOS 6's single sign-on, you're never prompted to enter the user name and password.\n\nWill be making pull request to fix logout. What else remains?", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-14T23:03:18.000+0000", "updated": "2013-03-14T23:03:18.000+0000" }, { "id": "242362", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_modules/pull/91", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-15T00:48:49.000+0000", "updated": "2013-03-15T00:48:49.000+0000" }, { "id": "242982", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Oh ick. Just realized I have a flaw in the login reporting code. Updating pull.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-19T18:49:40.000+0000", "updated": "2013-03-19T18:49:40.000+0000" }, { "id": "326963", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as fixed.\r\nTested Mac osx 10.9.5 Mavericks\r\nAppcelerator Studio, build: 3.4.0.201409261245\r\nTitanium SDK, build: 3.4.1.v20141003114920\r\nacs@1.0.18\r\nalloy 1.5.1\r\ninstall@0.1.7\r\nnpm@1.4.23\r\nsudo@1.0.3\r\ntitanium 3.4.0\r\ntitanium-code-processor@1.1.1\r\nXcode6.1GM\r\nDevice:\r\niPhone 6 iOS 8.1\r\nks 28a706e9-4130-4acb-bc76-9494255a9279\r\nversion 3.4.0", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-03T23:16:11.000+0000", "updated": "2014-10-03T23:16:11.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }