elsesiy / GAppAuth

Convenient Wrapper for AppAuth with Google Services written in Swift (>= 4).
BSD 2-Clause "Simplified" License
34 stars 9 forks source link

Using Authorize from SwiftUI view #17

Open infinitetrooper opened 3 years ago

infinitetrooper commented 3 years ago

Hello, Firstly, Thanks @elsesiy for the brilliant work.

Secondly, Is there any way to call the GAppAuth.shared.authorize from a SwiftUI view, The current implementation requires us to pass a UIViewController for presentingViewController but, I'm building an app in SwiftUI and would love to handle the auth without adding an extra view controller just for a login button.

Also, any plans to release a new version to support the updated GTMAppAuth and AppAuth releases?

Thanks Again!

elsesiy commented 3 years ago

@infinitetrooper Thank you for reaching out! I understand the inconvenience and would love to support SwiftUI natively. Unfortunately I'm not up-to-date with the latest Apple developments anymore and don't think I'll find the time to dig into that very soon. Feel free to submit a PR! I can look into updating the dependencies which should be quick (I hope)

infinitetrooper commented 3 years ago

Thanks @elsesiy, I will definitely look to create a PR for SwiftUI if I end up figuring out how to implement the same functionality as is currently supported. Will keep an eye out for dependencies update.

Tony1324 commented 3 years ago

Secondly, Is there any way to call the GAppAuth.shared.authorize from a SwiftUI view, The current implementation requires us to pass a UIViewController for presentingViewController but, I'm building an app in SwiftUI and would love to handle the auth without adding an extra view controller just for a login button.

I'm not familiar with UIkit so how would you do it with the adding an extra UI view controller way? I'm trying to make a multiplatform app for iOS and macOS so do I make separate things for UIViewController and NSViewController?

I am thinking off showing a sheet that has a sign in with google button