When using Apple SignIn via web (https://appleid.apple.com/auth/authorize + https://appleid.apple.com/auth/token) in id_token you will always have email available and user name is available only first time user signs in but not in id_token but in $_REQUEST["user"] when redirected to your redirect_uri..
On the other side when using Apple SignIn via swift you will have only first time available both user name and email. So if you would like to avoid solution mentioned in ask comment of @Harsha (creating internal table with pairs of user identificator and email) you can rather get autorizationCode in swift, transfer it to your backend/server and continue as in case of web SignIn - make request to https://appleid.apple.com/auth/token and you will have id_token with email field available for every sign-in not just first time sign-in. This is way how we solve it. In our case we however implemented also web login for website version of native app so it is no problem.
Just be careful.... in case web login client_id is your service identifier from https://developer.apple.com/account/resources/identifiers/list/serviceId + its client_secret created for example by lib https://github.com/gradus0/appleAuth . But in case native app client_id is app budle identifier which must be registered here https://developer.apple.com/account/resources/identifiers/list/bundleId + its client_secret generated with e.g. the same lib mentioned earlier.
let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential,
let authCodeData = appleIDCredential.authorizationCode,
let authCodeString = String(data: authCodeData, encoding: .utf8) {
// send authCodeString to your backend/server and continue as for web sign-in
// so you must make request to https://appleid.apple.com/auth/token to get id_token
// with user email
}