Private Relay Email when user selects "Hide My Email" not returning email in AppleIDCredentials..

We are implementing sign in with Apple(SiwA) for our iOS app. for the signup we require the user's Apple id and email address.
We are getting user name and email details everytime when User selects "Show My Email". When User selects "Hide My Email" the very first time only private relay email(unique email address) i am recieving. Second time for that user i am not recieving any email address in the appleIdCredentials object.


Some people from different forums suggested to decode the userIdentifier for the email address. Will it be good to decode it or any other way to handle it. Please suggest solution for handleing "Hide My Email" case.


Note : My Project is in Objective C.


Any help would be appreciated.Thanks in Advance.

Replies

We return the email only for the first time, for the second time you can get email by extracting appleIdCredential.identityToken

Please refer to the following document
https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/authenticating_users_with_sign_in_with_apple

We return the email only for the first time, for the second time you can get email by extracting appleIdCredential.identityToken

Unfortunately that isn't always true. We've found out in our team that identityToken is sometimes missing the email property. That field is critical for the registration process in our app and we haven't figured that out yet why this property is disappearing randomly.
I think I solved the issue in my project. It turned out that someone on the team used SIWA without defining the scope and every Apple account which used his version for the first time, would forever receive id_token's without email cause once you agree on a scope with the user, you stick with it forever. You can't extend the scope on next sign in. Only if user disconnects and reconnects his/hers Apple account with your app.