{ "id": "111702", "key": "AC-2145", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2013-04-01T22:54:16.000+0000", "created": "2013-03-26T13:31:43.000+0000", "labels": [ "facebook", "iphone" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:41:07.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I have the problem that the Event Listener doesn't get called under specific circumstances. It seems that when I try to add a FB App again to my FB profile with the same permissions the Event Listener doesn't get called and the Facebook WebView simply get closed. I need the event listener to transfer the FB Token to our Website / Database and to deliver a notification to the user.\r\n\r\n{code:JavaScript}\r\nTitanium.Facebook.appid = \"#####\";\r\nTitanium.Facebook.permissions = ['publish_stream', 'create_event', 'publish_actions', \"email\",\"user_about_me\",\"publish_stream\",\"publish_actions\",\"user_interests\",\"user_subscriptions\",\"user_education_history\",\"user_likes\",\"user_birthday\",\"user_location\",\"user_status\",\"user_website\",\"friends_about_me\",\"friends_games_activity\",\"friends_location\",\"friends_status\",\"friends_website\",\"friends_interests\",\"friends_notes\",\"friends_photos\",\"friends_relationships\",\"friends_subscriptions\",\"friends_work_history\",\"friends_activities\",\"friends_education_history\",\"friends_groups\",\"friends_likes\",\"friends_birthday\"];\r\n \r\nvar fbLoginListener = function(e) {\r\n if (e.success) {\r\n util.alert(L('FacebookRightsSetted'), L('FacebookPermissions'));\r\n } else if (e.error) {\r\n util.alert(L('FacebookRightsSettedError') + e.error, L('FacebookPermissions'));\r\n } else if (e.cancelled) {\r\n util.alert(L('FacebookRightsSettedAbort'), L('FacebookPermissions'));\r\n }\r\n if (core.isDefined(Ti.Facebook.uid) && core.isDefined(Ti.Facebook.accessToken)) {\r\n star.transferFacebookToken(Ti.Facebook.uid, Ti.Facebook.accessToken, function() {\r\n }, function() {\r\n util.alert(L('FacebookTokenTransmitError'), L('FacebookPermissions'));\r\n });\r\n }\r\n exit();\r\n };\r\n\r\n var fbLogoutListener = function fbLogoutListener(e) {\r\n util.alert(L('FacebookPermissionsOpen'), L('FacebookPermissions'), function(e) {\r\n if (core.isDefined(e)) {\r\n if (e.index == 0) {\r\n Ti.Facebook.appid = config.facebook_app_id;\r\n Ti.Facebook.permissions = config.facebook_scope;\r\n Ti.API.info('FB Permission we want = ' + JSON.stringify(Ti.Facebook.permissions));\r\n Ti.Facebook.addEventListener('login', fbLoginListener);\r\n setTimeout(function() {Titanium.Facebook.authorize();}, 750);\r\n }\r\n Ti.Facebook.addEventListener('logout', fbLogoutListener);\r\n }\r\n }, ['Ok', L('Cancel')], true);\r\n fbPermissionAlert = false;\r\n }\r\n function facebookLogout() {\r\n Ti.Facebook.accessToken = null;\r\n Ti.Facebook.expirationDate = null;\r\n Ti.Facebook.uid = null;\r\n Ti.Facebook.loggedIn = false;\r\n\r\n var url = 'https://login.facebook.com';\r\n var client = Titanium.Network.createHTTPClient();\r\n client.clearCookies(url);\r\n Titanium.API.info(\"logout from facebook.com == success\");\r\n\r\n var url = 'http://login.facebook.com';\r\n var client = Titanium.Network.createHTTPClient();\r\n client.clearCookies(url);\r\n if (Ti.Facebook.loggedIn == true) {\r\n Ti.Facebook.logout();\r\n } else {\r\n fbLogoutListener();\r\n }\r\n }\r\nTi.Facebook.addEventListener('logout', fbLogoutListener);\r\nfacebookLogout();\r\n\r\n\r\n{code} ", "attachment": [], "flagged": false, "summary": "Facebook login event listener is not capturing the login event", "creator": { "name": "marcoschierhorn", "key": "marcoschierhorn", "displayName": "Marco Schierhorn", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "marcoschierhorn", "key": "marcoschierhorn", "displayName": "Marco Schierhorn", "active": true, "timeZone": "Europe/Berlin" }, "environment": "iOS", "comment": { "comments": [ { "id": "245056", "author": { "name": "jbuckley", "key": "jbuckley", "displayName": "Jamie Buckley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Marco,\n\nCan you please provide some additional information on this issue:\n- Titanium Studio Version\n- Titanium SDK Version\n- iOS Version\n\nYou can see the full guidelines of how to submit a ticket here: https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report", "updateAuthor": { "name": "jbuckley", "key": "jbuckley", "displayName": "Jamie Buckley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-01T22:54:02.000+0000", "updated": "2013-04-01T22:54:02.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }