ios - React Native Firebase 动态链接 iOS
问题描述
我正在尝试使用 RNFirebase 通过电子邮件链接登录应用程序
signInWithDynamicLink = async url => {
const { dispatch, navigation } = this.props;
const isWithEmail = RNFirebase.auth().isSignInWithEmailLink(url);
if (isWithEmail) {
try {
dispatch(setSignInByEmail(true));
const signInEmail = await AsyncStorage.getItem('emailForLogin');
if (signInEmail) {
await RNFirebase.auth().signInWithEmailLink(signInEmail, url);
await AsyncStorage.removeItem('emailForLogin');
} else {
// Handle non sign in email link
}
} catch (error) {
console.log(error);
}
}
我可以在 Android 中使用 apiKey 检索长电子邮件链接url
。但是在 iOSurl
中只是来自 的重定向 url actionCodeSettings
,所以isWithEmail
永远都是false
. 我在我的代码中做错了吗?
url
在安卓中https://example.page.link/?link=https://project.firebaseapp.com/__/auth/...https://redirect-url.com%26lang%3Den
在 iOS 中https://redirect-url.com
这是我的动态链接处理程序的 AppDelegate.m
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<NSString *, id> *)options {
return [[RNFirebaseLinks instance] application:application openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray *))restorationHandler {
return [[RNFirebaseLinks instance] application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
}
更新
没关系。只需要将关联域更改为默认动态链接
解决方案
推荐阅读
- python - 如何将 PyObject 转换为 C++ 数组?
- python-3.x - 不同的 Python 安装
- sql - LOAD DATA INPATH 表文件以 Impala 中的某个字符串开头
- processing - 如何修复这个太阳系模型的处理?
- angular - Angular 5: Is there way hide API call? or make it private?
- c# - 如何在 CsvHelper 中为所有类映射设置默认 NULL 值
- python-3.x - 使用递归打印从起点到目的地的所有路径 - Python
- javascript - 访问同一“返回值对象”中的 javascript 函数
- android - 如何在android中比较两个可绘制的图像
- react-native - React Native:uri在flatlist中多次呈现