[iOS] sendEmailVerification fails to send email when ActionCodeSettings URL is provided - works on Android
Issue
I'm experiencing an issue with sendEmailVerification on iOS where emails are not sent when ActionCodeSettings with a URL is provided, while the same code works perfectly on Android.
Current Behavior
-
iOS: When
ActionCodeSettingswithurlparameter is provided → Email is NOT sent -
iOS: When
ActionCodeSettingsis omitted → Email is sent successfully (but without continue button) -
Android: Works perfectly with
ActionCodeSettingsand URL parameter
Expected Behavior
Email verification should be sent on both iOS and Android when ActionCodeSettings with URL is provided.
Code Sample
import { sendEmailVerification } from '@react-native-firebase/auth';
const actionCodeSettings = {
url: 'https://xxx.xxx/email-verification',
handleCodeInApp: true,
iOS: {
bundleId: 'com.xxx.app'
},
android: {
packageName: 'com.xxx.appl',
installApp: true,
minimumVersion: '12'
}
};
// This works on Android but fails silently on iOS (no email sent)
await sendEmailVerification(user, actionCodeSettings);
// This works on iOS but email has no continue button
await sendEmailVerification(user);
Configuration
Info.plist (iOS):
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>https://xxx.app</string>
</array>
</dict>
</array>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:xxx.xxx</string>
</array>
Firebase Console:
- Domain
xxx.xxxis added to Authorized domains - iOS app is properly configured with correct Bundle ID
Environment
- Platform: iOS (tested on iOS simulator and physical device)
- react-native-firebase version: [your version]
- React Native version: [your version]
- iOS version: [your iOS version]
- Firebase SDK version: [your version]
Additional Notes
This appears to be the same issue as #3364 from 2020, but that issue was marked as stale. The problem still persists in current versions.
Question
Is there a proper solution to make sendEmailVerification work with ActionCodeSettings URL on iOS, or is the platform-specific workaround the only viable solution?
Hi there, can you confirm its not appearing in the spam folder? Also do you get any errors when doing this on iOS or on gcp? Also what kind of account are you trying to verify email for?
Hi there, can you confirm its not appearing in the spam folder? Also do you get any errors when doing this on iOS or on gcp? Also what kind of account are you trying to verify email for?
I get the error right when calling the send mail function, so the email is never sent. For testing, I used a Yopmail account.
Hi there, can you please tell me if the solution here works? https://stackoverflow.com/questions/51178015/firebase-email-verification-not-working-with-actioncodesetting
Same here. Any update?
@napoleon-na if you are reading through the comments here it appears we have an open request for feedback. Did you see that? Did you try it? How did it go?
Hi there, can you please tell me if the solution here works? https://stackoverflow.com/questions/51178015/firebase-email-verification-not-working-with-actioncodesetting
@mikehardy
Yeah, I checked the link post. But it's not the same as my experienced. In my case, I got an error when call verifyBeforeUpdateEmail so that email is never sent.
Actually, I realized this after posting - the library I was using wasn't for React Native, but for Flutter. 😅 However, since the exact same issue occurred, I suspect the root cause might be similar.
Okay, going to resolve those comments as not actionable in this repo since not react-native-firebase, and reproduction details are unclear.
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.