joehinkle11 / Login-with-Apple-Firebase-SwiftUI

A SwiftUI component which handles logging in with Apple to Firebase
zlib License
179 stars 23 forks source link

Sign in with Apple Label change? #1

Open Speakmanity opened 4 years ago

Speakmanity commented 4 years ago

Hi Joe! Thank you for creating this repo!! It's been very helpful!

However, I wonder if there is anyway to indicate to the users that they have successfully signed in? For instance, maybe changing the Sign in with Apple Label to "Logged in" or change it into a sign out button?

Thank you so much!

joehinkle11 commented 4 years ago

Hey! Glad it's working for you. Under the hood I'm using ASAuthorizationAppleIDButton which doesn't manage sign in states for you. It just runs an auth and leaves you to the rest of it.

But I like the idea of this component handling sign in states between app sessions. And I also like the idea of having a sign out button, but I don't think it'd be a good idea to have the same SwiftUI component be the sign in and the sign out button though.

joehinkle11 commented 4 years ago

Here's an idea for an update.

  1. Remembering login sessions

I think it would be good if there was an automatic mode where you don't have to worry about sign in states between app launches.

SignInWithAppleToFirebase(.automatic)

But we would need to preserve a simple raw auth for those who want more complex flows.

SignInWithAppleToFirebase(.manual) { response in // manually handle login states ... }

  1. Sign out button

This would only apply to the automatic mode.

SignOutWithAppleAndFirebase()