{ "id": "104603", "key": "TIMOB-11699", "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": "15106", "description": "2013 Sprint 08", "name": "2013 Sprint 08", "archived": true, "released": true, "releaseDate": "2013-04-22" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2013-04-11T23:49:09.000+0000", "created": "2012-11-07T15:09:58.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "exalture" ], "versions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T21:37:58.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": "1. Login with Facebook using Ti.Facebook.authorize();\r\n2. Call win.close() to exit the app while still logged in exitOnClose:true \r\n3. Open app, user is already logged in to facebook. Call Ti.Facebook.logout()\r\n4. Call Ti.Facebook.authorize() to relogin. You may get the dialog to open and you're presented with a \"Log In button from facebook, clicking that button takes you to username/password fields. After authenticating in dialog window closes the facebook login event is never fired. It opens an error dialog window. Any subsequent calls to .authorize() you'll continue to get a flicker open /close behavior . Close and Reopen of app remains in the flicker open/close state when trying to call authenticate(). \r\n\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n\ttitle : 'Test',\r\n\tbackgroundColor : 'white',\r\n\texitOnClose : true\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttitle : 'Close window'\r\n});\r\nbtn.addEventListener('click', function() {\r\n\twin.close();\r\n});\r\n\r\nTi.Facebook.appid = \"134793934930\";\r\nTi.Facebook.permissions = ['publish_stream'];\r\n// Permissions your app needs\r\n\r\nif (Ti.Facebook.loggedIn) {\r\n\talert('Logged into facebook');\r\n\tTi.Facebook.addEventListener('logout', function(e) {\r\n\t\talert('Logged out');\r\n\t});\r\n\tTi.Facebook.logout();\r\n\tTi.Facebook.authorize();\r\n\r\n} else {\r\n\tTi.Facebook.addEventListener('login', function(e) {\r\n\t\tif (e.success) {\r\n\t\t\talert('Logged In');\r\n\t\t} else if (e.error) {\r\n\t\t\talert(e.error);\r\n\t\t} else if (e.cancelled) {\r\n\t\t\talert(\"Canceled\");\r\n\t\t}\r\n\t});\r\n\tTi.Facebook.authorize();\r\n}\r\nwin.add(btn);\r\nwin.open();\r\n\r\n{code}", "attachment": [], "flagged": false, "summary": "Ti.Facebook.authorize() fails to work after force close app while logged in", "creator": { "name": "jerodfritz", "key": "jerodfritz", "displayName": "Jerod Fritz", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jerodfritz", "key": "jerodfritz", "displayName": "Jerod Fritz", "active": true, "timeZone": "America/New_York" }, "environment": "Android 2.3.4\r\nSamsung Galaxy SII\r\nTi SDK 2.1.3", "comment": { "comments": [ { "id": "247214", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In the original test case, the event listener for 'login' is only added when not logged in. That's why it did not fire the 'login' event when you re-opened the app and re-logged in. \nFrom the SDK 3.1.0, facebook is a module. A modified test case is attached below:\n{code}\nvar facebook = require(\"facebook\");\n\nvar win = Titanium.UI.createWindow({\n title : 'Test',\n backgroundColor : 'white',\n exitOnClose : true\n});\n \nvar btn = Ti.UI.createButton({\n title : 'Close window'\n});\nbtn.addEventListener('click', function() {\n win.close();\n});\n \nfacebook.appid = \"134793934930\";\nfacebook.permissions = ['publish_stream'];\n\nfacebook.addEventListener('login', function(e) {\n\tif (e.success) {\n\t\talert('Logged In');\n\t} else if (e.error) {\n\t\talert(e.error);\n\t} else if (e.cancelled) {\n\t\talert(\"Canceled\");\n\t}\n}); \n\nfacebook.addEventListener('logout', function(e) {\n\talert('Logged out');\n}); \n\nif (facebook.loggedIn) {\n alert('Logged into facebook');\n facebook.logout();\n facebook.authorize();\n \n} else {\n facebook.authorize();\n}\nwin.add(btn);\nwin.open();\n{code}\nTested with latest master. facebook.authorize() works fine. Mark the ticket as Cannot reproduce.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-11T23:48:15.000+0000", "updated": "2013-04-11T23:48:15.000+0000" }, { "id": "414479", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue cannot be reproduced and due to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:37:58.000+0000", "updated": "2017-03-21T21:37:58.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }