p2 / OAuth2

OAuth2 framework for macOS and iOS, written in Swift.
Other
1.14k stars 278 forks source link

Callback when using SwiftUI SceneDelgate #333

Closed jcombs-pointblue closed 3 years ago

jcombs-pointblue commented 4 years ago

When using iOS13+ and SwiftUI, the callback will not be called if it's in the AppDelgate. You must move it to the SceneDelgate. This callback works there:

func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { print("In callback") for urlContext in URLContexts { let url = urlContext.url oauth2.handleRedirectURL(url) } // URL not auth related, developer should handle it. }

This should be added to the docs

cacaosteve commented 3 years ago

does this package actually support SwiftUI??? I don't see anything about that

ossus-lib commented 3 years ago

Added with #355 . Yes, cacaosteve, you can use this lib if you use SwiftUI in your own app.