Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swifter and SwiftUI: problems with swifter.authorize – code in succes: Swifter.TokenSuccessHandler never gets accessed #330

Open
DennisMoschina opened this issue Oct 20, 2020 · 1 comment

Comments

@DennisMoschina
Copy link

I am calling Swifter.authorize(withCallback: URL, presentingFrom: UIViewController, success: Swifter.TokenSuccessHandler, failure: Swifter.TokenFailureHandler) from a buttonpress in a UIViewControllerRepresentable. When clicking the Button, I am directed to a website in Safari to authorize my App. So far so good. After authorizing my app and getting returned by the Callback URL: “MyTwitterApp://“ neither the code inside Swifter.TokenSuccessHandler nor inside Swifter.TokenFailureHandler is run. Even the debugger does not step into it. In addition, at buildtime I get many warnings about init(account:) being deprecated since iOS 11.0 along other stuff. As I am using the newest version of Swifter and as I have found a fairly recent tutorial (definitely created after the launch of iOS 11) showing Swifter working, I am not sure if that creates any problem.

However, my main complaint is, that I am not able to authorize my app, as the code in success is not accessed.

@imthath-m
Copy link

in iOS 13+, it works only with the following method.

func authorize(withProvider provider: ASWebAuthenticationPresentationContextProviding,
               ephemeralSession: Bool = false,
               callbackURL: URL,
               forceLogin: Bool = false,
               success: TokenSuccessHandler?,
               failure: FailureHandler? = nil)

Have you tried it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants