swift2 - handleOpenURL won't trigger iOS Swift 2 -
i trying instagram authentication token app im working on, have app opening safari, im able log in , send me app, when transfers me app, handleopenurl not triggering in appdelegate. here sample of code:
import uikit @uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate { var window: uiwindow? .... func application(application: uiapplication, handleopenurl url: nsurl) -> bool { instagramapimanager.sharedinstance.processoauthstep1response(url) print(url) print("handleopenurl") return true } } and here api manager code triggering safari open:
import foundation import alamofire class instagramapimanager { static let sharedinstance = instagramapimanager() func startoauth2login() { let clientid: string = "abcdefg" let authpath:string = "https://api.instagram.com/oauth/authorize/?client_id=\(clientid)&redirect_uri=grokinstagram://?aparam=paramval&response_type=code" if let authurl:nsurl = nsurl(string: authpath) { uiapplication.sharedapplication().openurl(authurl) } } .... } any appreciated!
in ios 9, application:handleopenurl: deprecated. instead, should using:
func application(app: uiapplication, openurl url: nsurl, options: [string : anyobject]) -> bool {
Comments
Post a Comment