{"action":"created","issue":{"url":"https://api.github.com/repos/uber/rides-ios-sdk/issues/44","repository_url":"https://api.github.com/repos/uber/rides-ios-sdk","labels_url":"https://api.github.com/repos/uber/rides-ios-sdk/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/uber/rides-ios-sdk/issues/44/comments","events_url":"https://api.github.com/repos/uber/rides-ios-sdk/issues/44/events","html_url":"https://github.com/uber/rides-ios-sdk/issues/44","id":159692211,"number":44,"title":"Providing Custom Logic for LoginButton","user":{"login":"aasatt","id":8214352,"avatar_url":"https://avatars.githubusercontent.com/u/8214352?v=3","gravatar_id":"","url":"https://api.github.com/users/aasatt","html_url":"https://github.com/aasatt","followers_url":"https://api.github.com/users/aasatt/followers","following_url":"https://api.github.com/users/aasatt/following{/other_user}","gists_url":"https://api.github.com/users/aasatt/gists{/gist_id}","starred_url":"https://api.github.com/users/aasatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aasatt/subscriptions","organizations_url":"https://api.github.com/users/aasatt/orgs","repos_url":"https://api.github.com/users/aasatt/repos","events_url":"https://api.github.com/users/aasatt/events{/privacy}","received_events_url":"https://api.github.com/users/aasatt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-10T18:19:10Z","updated_at":"2016-06-10T19:51:56Z","closed_at":null,"body":"I would like to be able to handle the OAuth on my own if the user does not have the Uber app installed. I have been able to achieve this with using the `LoginManager` directly with my own button. \r\n\r\nHere's is my logic for handling it: \r\n\r\n        let loginManager = LoginManager()\r\n        loginManager.login(requestedScopes:[RidesScope.Request, RidesScope.AllTrips, RidesScope.Places], presentingViewController: self, completion: { accessToken, error in\r\n            print(\"Token: \\( accessToken?.tokenString)\")\r\n            print(error)\r\n            if error != nil {\r\n                uber.scopes = [\"request\", \"all_trips\", \"places\"]\r\n                uber.authorize { (result) in\r\n                    switch result {\r\n                    case .Success(let token) :\r\n                        print(\"Token: \\(accessToken)\")\r\n                        self.token = accessToken\r\n                        //handle successful login\r\n                        break\r\n                    case .Failure(let error) :\r\n                        print(error)\r\n                        //handle failed login\r\n                        break\r\n                    }\r\n                }\r\n            }\r\n        })\r\n\r\nA couple notes:\r\n1. I have yet to get the login manager to login successfully. It says that my app is not authorized for the requested scopes but when it falls back on my own OAuth, with the same scopes, it works. \r\n2. How do I make the SDK aware of the login after I handle it myself? "},"comment":{"url":"https://api.github.com/repos/uber/rides-ios-sdk/issues/comments/225279250","html_url":"https://github.com/uber/rides-ios-sdk/issues/44#issuecomment-225279250","issue_url":"https://api.github.com/repos/uber/rides-ios-sdk/issues/44","id":225279250,"user":{"login":"jbrophy17","id":5491168,"avatar_url":"https://avatars.githubusercontent.com/u/5491168?v=3","gravatar_id":"","url":"https://api.github.com/users/jbrophy17","html_url":"https://github.com/jbrophy17","followers_url":"https://api.github.com/users/jbrophy17/followers","following_url":"https://api.github.com/users/jbrophy17/following{/other_user}","gists_url":"https://api.github.com/users/jbrophy17/gists{/gist_id}","starred_url":"https://api.github.com/users/jbrophy17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbrophy17/subscriptions","organizations_url":"https://api.github.com/users/jbrophy17/orgs","repos_url":"https://api.github.com/users/jbrophy17/repos","events_url":"https://api.github.com/users/jbrophy17/events{/privacy}","received_events_url":"https://api.github.com/users/jbrophy17/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T19:51:55Z","updated_at":"2016-06-10T19:51:55Z","body":"see #45 regarding your first note"}}
{"actor":{"display_login":"jbrophy17"}}