{"action":"created","issue":{"url":"https://api.github.com/repos/foursquare/foursquare-ios-oauth/issues/6","labels_url":"https://api.github.com/repos/foursquare/foursquare-ios-oauth/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/foursquare/foursquare-ios-oauth/issues/6/comments","events_url":"https://api.github.com/repos/foursquare/foursquare-ios-oauth/issues/6/events","html_url":"https://github.com/foursquare/foursquare-ios-oauth/issues/6","id":60488150,"number":6,"title":"Native FS app stuck in limbo","user":{"login":"webdevotion","id":50583,"avatar_url":"https://avatars.githubusercontent.com/u/50583?v=3","gravatar_id":"","url":"https://api.github.com/users/webdevotion","html_url":"https://github.com/webdevotion","followers_url":"https://api.github.com/users/webdevotion/followers","following_url":"https://api.github.com/users/webdevotion/following{/other_user}","gists_url":"https://api.github.com/users/webdevotion/gists{/gist_id}","starred_url":"https://api.github.com/users/webdevotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdevotion/subscriptions","organizations_url":"https://api.github.com/users/webdevotion/orgs","repos_url":"https://api.github.com/users/webdevotion/repos","events_url":"https://api.github.com/users/webdevotion/events{/privacy}","received_events_url":"https://api.github.com/users/webdevotion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-10T11:54:18Z","updated_at":"2015-03-10T19:57:09Z","closed_at":null,"body":"Hello\r\n\r\nUsing Xcode 6.1 + 6.2 ( stable ) and iOS 7+ ( more specifically testing now with 8.1 + 8.2 ).\r\n\r\n### Works while developing\r\nWhen I run my app on my iPhone attached to Xcode my flow works.  I can authenticate using FS oAuth just fine.  When I detach that same phone and restart the dev version of the app, it works fine.\r\n\r\n### Failing scenarios when using TestFlight builds:\r\n\r\nApple only allows 2 TestFlights builds every 24 hours and this restriction makes it very hard to debug through iterating.\r\n\r\n##### 1. if FS is not open ( in the background )\r\n- it opens and shells to FS app\r\n- and just sits there inside FS  \r\n\r\n##### 2. if FS is open ( in the background )\r\n- it does open and comes back to our app\r\n- but than it triggers the following error\r\n\r\n### Error \r\n\r\nThis is the error we receive from our code when FS does come back with a response.\r\n\r\n```objc\r\nFoursquare url callback failed: Error Domain=foursquare Code=6243655616 \"The operation couldn’t be completed. (foursquare error 6243655616.)\" UserInfo=0x174269fc0 {reason=Could not determine the problem}\r\n```\r\n\r\nThis is the code that renders our `NSErrors`:\r\n```objc\r\nFSOAuthErrorCode *errorcode;\r\nNSString *accesscode = [FSOAuth accessCodeForFSOAuthURL:url error:errorcode];\r\n\r\nNSError *error = nil;\r\n            \r\nif( *errorcode == FSOAuthErrorUnknown )\r\n{\r\n    error = [NSError errorWithDomain:@\"foursquare\" code:*errorcode userInfo:@{@\"reason\":@\"We could not determine the reason of the error.\"}];\r\n}\r\nelse if( *errorcode == FSOAuthErrorInvalidRequest)\r\n{\r\n    error = [NSError errorWithDomain:@\"foursquare\" code:*errorcode userInfo:@{@\"reason\":@\"Invalid request\"}];\r\n}\r\nelse if( *errorcode == FSOAuthErrorInvalidClient)\r\n{\r\n    error = [NSError errorWithDomain:@\"foursquare\" code:*errorcode userInfo:@{@\"reason\":@\"Invalid client\"}];\r\n}\r\nelse if( *errorcode == FSOAuthErrorInvalidGrant)\r\n{\r\n    error = [NSError errorWithDomain:@\"foursquare\" code:*errorcode userInfo:@{@\"reason\":@\"Invalid grant\"}];\r\n}\r\nelse if( *errorcode == FSOAuthErrorUnauthorizedClient)\r\n{\r\n    error = [NSError errorWithDomain:@\"foursquare\" code:*errorcode userInfo:@{@\"reason\":@\"Unauthorized client\"}];\r\n}\r\nelse if( *errorcode == FSOAuthErrorUnsupportedGrantType)\r\n{\r\n    error = [NSError errorWithDomain:@\"foursquare\" code:*errorcode userInfo:@{@\"reason\":@\"Unsupported grant type\"}];\r\n}else{\r\n\r\n    error = [NSError errorWithDomain:@\"foursquare\" code:*errorcode userInfo:@{@\"reason\":@\"Could not determine the problem\"}];\r\n}\r\n\r\nDDLogWarn( @\"Foursquare url callback failed: %@\", error );\r\n```\r\n\r\n### Podfile\r\n\r\n```ruby\r\n...\r\npod 'FSOAuth', :git => 'https://github.com/foursquare/foursquare-ios-oauth.git', :tag => 'v1.1'\r\n...\r\n```\r\n\r\n### Targets\r\n\r\nWe do not use different nor do we have complex setups to differentiate between debug / release / staging / ... builds.  I removed `Crashlytics` and `Reveal` from the project to isolate the problem.  But we did not see any improvement.\r\n"},"comment":{"url":"https://api.github.com/repos/foursquare/foursquare-ios-oauth/issues/comments/78134809","html_url":"https://github.com/foursquare/foursquare-ios-oauth/issues/6#issuecomment-78134809","issue_url":"https://api.github.com/repos/foursquare/foursquare-ios-oauth/issues/6","id":78134809,"user":{"login":"webdevotion","id":50583,"avatar_url":"https://avatars.githubusercontent.com/u/50583?v=3","gravatar_id":"","url":"https://api.github.com/users/webdevotion","html_url":"https://github.com/webdevotion","followers_url":"https://api.github.com/users/webdevotion/followers","following_url":"https://api.github.com/users/webdevotion/following{/other_user}","gists_url":"https://api.github.com/users/webdevotion/gists{/gist_id}","starred_url":"https://api.github.com/users/webdevotion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdevotion/subscriptions","organizations_url":"https://api.github.com/users/webdevotion/orgs","repos_url":"https://api.github.com/users/webdevotion/repos","events_url":"https://api.github.com/users/webdevotion/events{/privacy}","received_events_url":"https://api.github.com/users/webdevotion/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T19:57:09Z","updated_at":"2015-03-10T19:57:09Z","body":"You used to just upload a new build yes :)  But Apple bought it and now it's a little bit less convenient to use.  Will figure something out.  As always, there is a looming deadline and going over the other features atm.\r\n\r\nI will take your last comment into consideration and will report back. Thank you for your input.  Appreciated."}}