I did look at that one, thanks. Can you give me a bit more with regard to flow? Here is the code I have been using that now doesn't work because of the complete URL requirement.
print("(CEcoobeeAPIConnect) Requesting Flair API authorization token")
// callbackUrlScheme = "com.SmartVentsTwo://auth"
callbackUrlScheme = "https://com.SmartVentsTwo://auth"
callbackUrlScheme = callbackUrlScheme.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!
let authURL = URL(string: "https://api.ecobee.com/authorize?response_type=code&client_id= SMART_APP_CLIENT_ID&redirect_uri=(callbackUrlScheme)&scope=smartWrite&state=SmartVentRequest")
print("(CEcobeeAPIConnect) App Authorization request URL is (authURL!.absoluteString)")
self.m_webAuthSession = ASWebAuthenticationSession.init(url: authURL!, callbackURLScheme: callbackUrlScheme, completionHandler:
{ (callBack:URL?, error:Error?) in
print("(CEcoobeeAPIConnect) Ecobee API authorization token request returned, callbackURL is (String(describing: callBack))")
// handle auth response
……
}})