{ "id": "112688", "key": "AC-1817", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-12-03T21:38:24.000+0000", "created": "2013-04-11T09:14:50.000+0000", "labels": [ "triage" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:40:43.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": "14550", "name": "Appcelerator Modules", "description": "Please enter tickets related to Modules here." }, { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Steps to reproduce:\r\n\r\n1. App with Facebook login: Login to Facebook.\r\n2. Shut down app\r\n3. Launch app again\r\n\r\nActual Result:\r\nThe app triggers the facebook login event again.\r\n\r\nExpected result:\r\nThe app does not trigger the facebook login event on launch.\r\n", "attachment": [], "flagged": false, "summary": "iOS: Facebook Login event is triggered on opening the app", "creator": { "name": "wgiezeman", "key": "wgiezeman", "displayName": "Wienke", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "wgiezeman", "key": "wgiezeman", "displayName": "Wienke", "active": true, "timeZone": "Europe/Berlin" }, "environment": "SDK 3.1 release candidate on iOS 6.1 iPad Simulator", "comment": { "comments": [ { "id": "247380", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Okay, I poked around, and this is an intentional behavior change for iOS, partially as a result of iOS 6's OS-wide authentication. That is, once you've logged in, you're logged in until you actively log out.\n\nThe reasoning is that 1) there's only one account you can be associated with, and 2) there should be no difference between the app being backgrounded and foregrounded and the app being backgrounded, stopped, and relaunched. Logging in when you were previously logged in helps maintain this consistency. This is also done to ensure your app session is extended.\n\nIf you log out, this is honored and it doesn't try to log you in on app launch. However, your app may suffer reviews because it will appear as if your application cannot stay logged in.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-12T23:25:18.000+0000", "updated": "2013-04-12T23:25:18.000+0000" }, { "id": "247400", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{quote}\n\"there should be no difference between the app being backgrounded and foregrounded and the app being backgrounded, stopped, and relaunched. Logging in when you were previously logged in helps maintain this consistency. This is also done to ensure your app session is extended.\"\n{quote}\nThat sounds contradictory - logging in when you were previously logged in... helps to maintain the... OS-wide authentication? It should remain persistent right?\n\nI'm not sure how the very latest Facebook iOS SDK works (I use the 3.1 FB SDK natively), but I store the access token and expiration date in NSUserDefaults so that the login persists between app launches. This is on iOS 6.\n\nAs for backgrounding, I call extendAccessTokenIfNeeded on app resume.\n\nThis ensures I don't get the login screen again for a while, even after the app is killed.\n\n@Wienke - It might be worth explaining what you mean by \"Shut down app\" - do you mean kill the app, or send to the background?", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-13T03:02:35.000+0000", "updated": "2013-04-13T03:02:35.000+0000" }, { "id": "247426", "author": { "name": "wgiezeman", "key": "wgiezeman", "displayName": "Wienke", "active": true, "timeZone": "Europe/Berlin" }, "body": "@Blain: That the user needs to stay logged in after relaunching the app I would expect to indeed be the case. The issue I am encountering is that the login event is triggered every time the app launches. I would say this is not needed. I think this event is mainly because you want the system to know the app was reopened from the Facebook app.\n\n@Daniel: What I mean with shut down is actually having the app completely closed and then open it again. I am not referencing foreground/background switches.\n\nIf this is actually designed this way I please let me know. Then I will not add an eventlistener for the Facebook login once the user is logged in.", "updateAuthor": { "name": "wgiezeman", "key": "wgiezeman", "displayName": "Wienke", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-13T15:34:24.000+0000", "updated": "2013-04-13T15:34:24.000+0000" }, { "id": "247729", "author": { "name": "wgiezeman", "key": "wgiezeman", "displayName": "Wienke", "active": true, "timeZone": "Europe/Berlin" }, "body": "@Ingo: Any news on this issue? Still think this is not working as expected.", "updateAuthor": { "name": "wgiezeman", "key": "wgiezeman", "displayName": "Wienke", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-16T07:49:15.000+0000", "updated": "2013-04-16T07:49:15.000+0000" }, { "id": "247800", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~wgiezeman] We are still discussing if this is expected behavior. If we do make a change, we release it as a new version of the module you can download directly.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-16T16:53:52.000+0000", "updated": "2013-04-16T16:53:52.000+0000" }, { "id": "247837", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Okay, I tested this, and the situation is thusly:\n\nWhen an application starts up, as in was completely stopped (first time running or was quit, not just backgrounded), there is no state, as the program hasn't talked with Facebook for a while. Sure, you might have saved credentials since the last time the app was running, but it's possible the user login has changed (in the case of iOS 6.0 and system-wide login) or that the user has revoked permissions through facebook. Either way, we have to refresh credentials with the very real possibility that the app is logged out.\n\nThe thing is that refreshing the credentials includes a silent login attempt. The app does not prompt the user, so this is behind the scenes from their point of view. On a successful refreshing of credentials, login information updates and changes. Since the app is transitioning from 'not logged in' or 'possibly logged in at best' to 'known logged in', this triggers a login event for the app to ensure that the app updates state accordingly.\n\nNote that when the app is merely backgrounded and foregrounded, the app has not quit, so its state was known, so that it did not need to announce being logged in since that was already the case.\n\nThis is all expected and desired behavior. The reason this happens now as opposed to before is that before FB3.0, we did not have the update credentials functionality.\n\nMoving to mark this ticket as invalid.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-16T20:58:34.000+0000", "updated": "2013-04-16T20:58:34.000+0000" }, { "id": "247842", "author": { "name": "wgiezeman", "key": "wgiezeman", "displayName": "Wienke", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for the clarification. This makes sense. It might be an idea to explain this also in the documentation.", "updateAuthor": { "name": "wgiezeman", "key": "wgiezeman", "displayName": "Wienke", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-16T21:36:28.000+0000", "updated": "2013-04-16T21:36:28.000+0000" }, { "id": "280954", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Invalid issue. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-24T22:18:20.000+0000", "updated": "2013-11-24T22:18:20.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }