Sign in with Apple ASAuthorizationAppleIDCredential returns random email when user select 'Hide My Email' option for iOS - ios

When I go through the Sign in with apple I am getting first time exact email address and basic details of the user which I want but second time in response there is no email field in response.
My concern is that I want email address of the user so in future I can send notification email to that particular user. but apple gives random created email, in reality that doesn't exists. How to contact to user in future by email?

You might have to register the outbound email with apple, check this for more information on using the private email provided also look at the sign in with apple docs here.

As far as I know the random created email apple gives is actually connected to user's actual mail id. All the mail you send will be forwarded to it. But they can unlink their mail in future. This gives users some privacy and protection from spamming.

When I was finding solution I got to know, we have to pass an email address for following:
The email addresses you register will be able to send and receive messages to and from customers using Appleā€™s private email relay service.
Once I added this I am able to send and receive the emails.
https://developer.apple.com/account/resources/services/configure

Short answer :
You need to add sender email id or domain name into to your developer account.
Add your email and domain name.
Long answer
You need to follow below steps:
Log in with your developer account in https://developer.apple.com
Goto More section. Please refer below screenshot.
Click on configure button. Please refer below screenshot.
Add domain and email address, You want to communicate.
Add email and domain here

Related

is unique email address from Apple when performing 'Sign in using Apple' always change?

I am trying to make login using OAuth2 using Apple Sign in. and I need to save the user email to the server.
after reading Sign in with Apple and authenticate with Firebase documentation , it said that
Unlike other providers supported by Firebase Auth, Apple does not
provide a photo URL.
Also, when the user chooses not to share their email with the app,
Apple provisions a unique email address for that user (of the form
xyz#privaterelay.appleid.com), which it shares with your app. If you
configured the private email relay service, Apple forwards emails sent
to the anonymized address to the user's real email address.
apple will generate unique fake email like xyz#privaterelay.appleid.com if the user refuses to share their original email.
if the user logout and then login again, will the fake email will be the same? or apple will generate a new fake email like new123#privaterelay.appleid.com ?

Firebase Email verification with SMS like Code

It is possible to use email verification with firebase but instead of sending a link they have to click, it should send a code like a sms verification code and i have to check in my ios app (swift based) if they match.
Email verification ensures that the user has access to the email address they claim. Setting an email address to verified by sending a text message is not the same, as you can't know from the receipt of the text message that they have access to the email address.
But as A. Welch commented, you can verify that the user has access to a specific phone number by using Firebase's phone number authentication as documented here: https://firebase.google.com/docs/auth/ios/phone-auth
If neither of those does precisely what you want, you can also roll your own. Send a text message or email with whatever information you want, and use the Firebase Admin SDK to update the user profile.

Setting default from address of email in ios

In my app, there is an email functionality which should send email from an id, which is not configured with mail app. From address will be like noreplyATgmail.com .. some thing like that.
How can I hard code the from address of an email ?
It's impossible to send email from account where user isn't authorised in.
For your aims it's better implement email functionality on server side that could be authorised to send emails from address that you specified.
As per my comment - you can't, you should use reply-to for that, or send a request to a server to send the email. The from gets set from the selected email address you eventually chose to send the email with.
For example:
mailto:email#email.com?subject=Subject&reply-to=noreply#something.com
I don't think there's anyway to do this using MFMailComposeViewController.

Altering the "From" or "Reply to" in google SMTP

I want to provided "Email a friend" functionality to my site. I have a ASP.MVC site and I am using GMail as our provider (google apps for business).
So, a user will press my "Email a friend" button and be asked to enter their "reply to email address" and the persons email the wish to send the email to. I then use our log in credentials to send the email. The problem is the the "reply to" address is changed to the credentials address.
So bob#home.com wants to send an email to tom#home.com. He enters the correct email addresses for both tom and himself. But when tom get the email its reply to is "sendingsite#gmail.com" which are the log in credentials.
I have done some research on this and as far as i understand this is not possible in gmail.... I believe.
My question is two fold.
Is this possible in gmail?
If not, how would i go about getting this functionality?
I know there are third party tools which do this and are free etc but we dont want to use these due to privacy issues.
Is this possible in gmail? AFAIK it is not possible to change the FROM address to anything that is not either the google apps account name for the SMTP settings or an alias of it. I believe you can change the REPLYTO address. In System.Net.Mail.MailMessage, there is a ReplyToList property. Are you setting the replyto there?
If not, how would i go about getting this functionality? Try something besides gmail / google apps for business. I have heard good things about SendGrid.
Also be careful with this. GA4B has a limit on the number of mails that can be sent in a specific time period. If you violate this, G will detect that you are abusing the service and lock the account you are sending mails from. They intend their service to be used by people, not machines, to send mail. All it takes is 1 automated attack on your send-to-friend page to disable your GA4B account, so consider a captcha or some other human-proof widget.

Get default user email in iOS Device

Is it possible to retrieve the user email associated with the default email account directly from an app?
Screenshot:
Thanks.
I can't prove a negative, but I am fairly certain this is not possible. You can use MFMailComposeViewController to allow the user to send an email from the default account, but you cannot directly access information about the default account. If you need the user's email address, you either have to ask for them to type it in, or have them select it from their contacts.
In addition to #woz answer, this is a gist that can help you.
In my app, I have a feedback form to let users could get in touch with me. Unfortunately, many users had minor misspellings in their email addresses and I couldn't reach back to them.
As I couldn't get a perfect way to be sure the email was correct, I've developed the following gist which:
asserts the mail is a proper foo#bar.tld
verifies that the email is contained in the user's address book
if not, suggests the closest match
Again, this is far from perfect and I only included this behavior optionally (a little 'check mail' button next to the UITextField)
https://gist.github.com/dirtyhenry/7547064

Resources