 import Foundation
 import Alamofire
 import SwiftyJSON
+import SafariServices
 
 /**
  StravaClient responsible for making all api requests


extension StravaClient {
    
    /**
     Opens the Strava OAuth web page in mobile Safari for the user to authorize the application.
     **/
    public func authorize() {
        UIApplication.shared.openURL(Router.authorizationUrl)
    }
    
    /**

     - Returns: the OAuth code
     **/
    public func handleAuthorizationRedirect(_ url: URL) -> String?  {
        safariViewController?.dismiss(animated: true, completion: nil)
        safariViewController = nil
        return url.getQueryParameters()?["code"]
    }
    
