Friday 30 October 2020

Swift: Share Auth state between apps

Inside my app the user can sign in with Apple, Google, Facebook and Email using Firebase. I also have a Share Extension and I would like to share the auth-state from the Main-App so I can also call Auth.auth.currentUser inside my ShareExtension so the user can access Cloud-Firestore.

Now I know there is this documentation provided by Firebase. However I am not sure about Step 2:

do {
   try Auth.auth().useUserAccessGroup("TEAMID.com.example.group1")
} catch let error as NSError {
   print("Error changing user access group: %@", error)
}

Where exactly do I have to call this?



from Swift: Share Auth state between apps

No comments:

Post a Comment