{ "id": "63424", "key": "TIMOB-2792", "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:56:11.000+0000", "created": "2011-04-15T03:29:41.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "defect", "facebook", "ios", "reported-1.6.0", "rplist" ], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-20T16:59:32.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": "{html}
If a user clicks \"Don't Allow\" when an app asks for additional\ninformation, evt.success and hasPermission will still return \"true\"\nfor this permission, when they should return false. This false\npositive only occurs in iOS, in my testing.
\nThe following sample code demonstrates the problem.
\nUse the following steps to reproduce in sample code:
\n1. Click \"Connect with Facebook\"
\n2. Sign in
\n3. Click \"Don't Allow\"
\n/**\n* Function that logs the user into Facebook, and makes sure they have\n* granted us the \"user_checkins\" permission.\n*/\nfunction checkIfUserIsLoggedIntoFacebook() {\n // if user hasn't logged in yet, don't do anything\n // (they need to click the \"Connect with Facebook\" button)\n if (Titanium.Facebook.isLoggedIn() === false) {\n }\n // if the user hasn't given us the permissions we want, request them.\n else if (!Titanium.Facebook.hasPermission(\"user_checkins\")) {\n Titanium.Facebook.requestPermission(\"user_checkins\", function (evt) {\n if (evt.success) {\n alert('Permission GRANTED');\n } else {\n alert(\"Permission DENIED\");\n }\n });\n }\n // otherwise, we should be good to go\n else {\n alert('Permission ALREADY GRANTED');\n }\n}\n\n/**\n* Add a login event listener so we can check if we have all the permissions\n* we want.\n*/\nTitanium.Facebook.addEventListener('login', function (evt) {\n if (evt.success) {\n checkIfUserIsLoggedIntoFacebook();\n }\n});\n\n// create our window\nvar win = Ti.UI.createWindow({ backgroundColor: '#fff' });\nwin.add(Ti.Facebook.createLoginButton({\n apikey: '645bf1d897d1fa8dc93ed45bc37edc04',\n secret: '49d146f85b8429438262380b85f2ebac',\n style: 'wide'\n}));\nwin.open();
\n
\nTested on CI build 1.6.0 from January 8th, 2010.
\nBROKEN on iPhone Simulator, 4.2
\nWORKS on Android Simulator APIs 2.2
The easy fix for this (short of ripping out and replacing the\nFacebook module with new code, which is ideal) is to change one\nline in the FBConnect/FBDialog.m (line 391 in Mobile SDK\n1.5.1).
\nThe line should change FROM:
\nif ([url.resourceSpecifier isEqualToString:@\"cancel\"]) {
\n
\nTO:
\nif ([[url.resourceSpecifier substringToIndex:6] isEqualToString:@\"cancel\"]) {
\n
\nAttached is a patch file that accomplishes that. Again, ideally,\nthe new FBConnect module gets put in place which also includes new\npermissions and proper resposes to their new API. The current REST\nAPI is being deprecated.
Having this broken also affects\nTitanium.Facebook.requestPermission, and causes it to not pop up a\ndialog if a user previously declined it.
\nJesus H. Christ's patch above fixes that too, though! Thanks,\nJesus.