Rank 1: Thread
I am trying to add Sign in with Apple to my app. I added the AppID, Service ID, etc in the developer's portal. I also configured the Appwrite to enable the Sign in with Apple service. I used the Service ID (Not the bundle ID) in the AppWrite's Apple OAuth. I write the following code in the SignInWithAppleButton's onCompletion closure.
do {
_ = try await account.createOAuth2Session(provider: .apple, scopes: ["email", "fullName"])
print("Successfully signed in with Apple!")
} catch {
print("Failed to create session: \(error.localizedDescription)")
}
The app ends up opening up the sign in sheet in the app -> Pop to website -> Sheet appears again -> go back to the app. Not only this weird problem, here are some more:
- I can trap the callback with .onOpenURL in the SwiftUI view. But it is kind of weird and not sure whether the user has been logged in successfully or not. How to do that properly?
- I can see the Apple ID is being added to the AppWrite Auth's user list. but it only able to track the email not the name. Would I be able to do that?
I tried to search the internet tutorial but most of them are for SignInWithApple + Web App. I can't find any proper tutorial for native SwiftUI app. If any info you have may help, please feel free to let me know.