{ "id": "62688", "key": "TIMOB-2056", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-15T03:09:12.000+0000", "created": "2011-04-15T03:09:10.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "facebook" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-03-02T19:25:40.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
app.js:
\n\n/*global Ti, Titanium, alert, JSON */\nTitanium.UI.setBackgroundColor('#000');\nvar win = Titanium.UI.createWindow({ \n title:'Test',\n backgroundColor:'#fff',\n exitOnClose: true\n});\n\nvar fbButton = Titanium.Facebook.createLoginButton({\n 'style':'wide',\n 'apikey':'9494e611f2a93b8d7bfcdfa8cefdaf9f',\n 'sessionProxy':'http://api.appcelerator.net/p/fbconnect/',\n bottom:10\n});\nwin.add(fbButton);\n\nvar status = Ti.UI.createButton({\n title:'Publish Status', width:200, height:40, top:60\n});\nwin.add(status);\n\nstatus.addEventListener('click', function()\n{\n if (!Titanium.Facebook.isLoggedIn())\n {\n Ti.UI.createAlertDialog({title:'Facebook', message:'Login before publishing to your stream'}).show();\n return;\n }\n\n Titanium.Facebook.publishStream(\"Set your status\",null,null,function(r)\n {\n if (r.success)\n {\n Ti.UI.createAlertDialog({title:'Facebook', message:'Your status was published'}).show();\n }\n else\n {\n Ti.UI.createAlertDialog({title:'Facebook', message:'You canceled, or there was an error'}).show();\n }\n });\n \n});\n\nwin.open();
\n
\nLaunch this app.js.
\nUse the \"Connect with Facebook\" button to login to Facebook.
\nAfter you have successfully logged in, go back to Ti Developer\nand re-launch the application. (You don't need to click the\n\"Publish Status\" button at all in this round.
\nWhen the application re-launches, you should see that you are\nstill logged into Facebook (the blue Facebook button will say\n\"logout\" instead of \"Connect with Facebook\" -- i.e., you are still\nlogged in.)
\nNow click the \"Publish Status\" button. An empty Facebook Connect\nview will show up instead of the expected view which should show\nyou fields in which to type and submit your status.
\nAttached .diff to help with logging. Haven't committed any of\nthis yet.
I could overcome this problem by erasing the activity cookies in\nFacebookModule.executeLogin.I also unsave the session so that if\nanother user will log in, it will be asked for credentials.
\nCookieSyncManager.createInstance(activity);
\nCookieSyncManager csm = CookieSyncManager.getInstance();
\nCookieManager cm = CookieManager.getInstance();
\ncm.removeAllCookie();
\ncsm.sync();
\nsession.unsave(activity);
After this I still had a FileNotFoundException when loading\nhttps://graph.facebook.com/me?var=val&...&method=me.\nIt worked for me after commenting out the following line on\nFBRequest.java (method callWithAnyData() )
\nmParams.put(\"method\", mMethod);
\nHope this may be of help
With the Titanium 1.6.0 changes to the facebook module, the\nequivalent code for the above test case would now be:
\n\nTitanium.UI.setBackgroundColor('#000');\nTi.Facebook.appid = \"YOUR FACEBOOK APP ID\";\nvar win = Titanium.UI.createWindow({ \n title:'Test',\n backgroundColor:'#fff',\n exitOnClose: true\n});\n\nvar fbButton = Titanium.Facebook.createLoginButton({\n 'style':'wide',\n bottom:10\n});\nwin.add(fbButton);\n\nvar status = Ti.UI.createButton({\n title:'Publish Status', width:200, height:40, top:60\n});\nwin.add(status);\n\nstatus.addEventListener('click', function()\n{\n if (!Titanium.Facebook.loggedIn)\n {\n Ti.UI.createAlertDialog({title:'Facebook', message:'Login before publishing to your stream'}).show();\n return;\n }\n Ti.Facebook.dialog(\"feed\", {},function(){});\n});\n\nwin.open();
\n
\nI cannot re-create the failcase with the new Facebook module, so\nI'll mark this as \"invalid\" (though it was not originally invalid)\nto close it.
@Leo Acevedo: regarding destroying FB sessions, you might be\ninterested in the approached described in #3025.
@Bill Dawson: indeed, it would have been great to know this in\nadvance, thanks a lot :)