2

So, in my Swift app, I'm doing SoundCloud auth with this sdk. I have my redirect URI set up as appname in the info.plist, and the SoundCloud redirect URI set as appname://authorized on the SC website. However, my function in the app delegate isn't getting called after logging in. Is there anything I'm missing?

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
    print("function called")

    return true
}

Is this the correct function I'm supposed to implement?

2
  • where is the documentation on setting up redirect url ? the github page doesnt have it. Commented Apr 25, 2016 at 18:16
  • Yes this is correct function. If your app is running and in background openURL should be called but if app is in not active or terminated state then you have to check in disFinishLaunching Commented Apr 25, 2016 at 18:29

2 Answers 2

0

That method has been deprecated.

https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623073-application

Use application(_:open:options:) instead: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application

func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
    return true
}
Sign up to request clarification or add additional context in comments.

Comments

0

For iOS 13 you also have to opt out of window scenes to get that application delegate's method called.

If you don't there are the corrispettive methods of the Scene delegate

 - (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts

Which apparently is not entirely enough:

Credit: https://stackoverflow.com/a/60022010/8517882

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.