Closed JerelRocktaschel closed 4 years ago
Does the app open back up after authentication? Check if the application(:open:options:)
method is actually called. I am not able to reproduce this with the sample app in Swifter.
If it is not, it is likely that you did not register the url scheme in the app so that iOS can recognize it. Something like the following should be added to your Info.plist
Ok I figured it out thanks to your help. I didn't have this Scene Delegate set up and now I have a successful authentication.
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
guard let context = URLContexts.first else { return }
let callbackUrl = URL(string: "SwifterTest:/")!
Swifter.handleOpenURL(context.url, callbackURL: callbackUrl)
}
Appreciate your help, Andy.
Awesome, glad you figured it out. Closing this now.
Hi - I am using swifter.authenticate with a callback URL and while Twitter recognizes a successful authentication, the closure block is never called. Here are my steps.
Registered an app on Twitter and retrieved API/Secret keys. Also registered a callback URL of "SwifterTest://" and a website URL.
Loaded latest version of Swifter to my Xcode project via Cocoapods.
pod 'Swifter', :git => 'https://github.com/mattdonnelly/Swifter.git', :tag => '2.4.0'
Added a new URL Type with the callback URL to the Xcode project.
Added code to the App Delegate:
Added code to ViewDidLoad in default ViewController
I am presented with the Twitter authorization screen and I enter my ID/password and after selecting Authorize, I am presented with a dialog to open in my app, which it does successfully. I also see the authentication on Twitter. However, the callback in the authorize function is never called. I see no SUCCESS or ERROR in the logs.
Feels like some sort of setting that needs to be set. Any help is greatly appreciated. Thank you for looking.
Edited for syntax highlighting