【发布时间】:2020-01-03 11:50:58
【问题描述】:
我已经为我的 react-native 应用设置了无密码身份验证,因为它需要设置我成功完成的 firebase 动态链接。
在 Android 和 iOS 平台上一切正常,但是在我将我的分支与 master 合并后,它在 iOS 上停止工作。 这意味着我收到了 SignIn 的电子邮件,但该链接没有打开 iOS 应用程序,但它在 Android 上成功运行。
我执行了以下步骤来设置 iOS 的动态链接:
AppDelegate.m
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
@import Firebase;
//Deep Linking RNavigation Docs
#import <React/RCTLinkingManager.h>
//Deep Linking RNavigation Docs
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"realyze"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[FIRApp configure];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
//Deep Linking RNavigation Docs
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
return [RCTLinkingManager application:app openURL:url options:options];
}
//Deep Linking RNavigation Docs
@end
添加了关联域功能 在 Xcode 和我的特定应用程序的 Apple 开发者帐户中
将 TeamID 添加到 Firebase 控制台作为 appID 前缀。
添加了这些 Firebase 授权域: 应用链接:reallyze.page.link 活动继续:realyze.page.link
还将域添加到权利文件中
6.app-site-associations-file 也设置正确
在我合并我的分支之前,此设置对我有用。
非常感谢您的帮助。
谢谢。
【问题讨论】:
-
您已经解决了这个问题吗?与同样的问题作斗争!它在 safari 中开放吗?
-
嘿,有更新吗?
-
@SafakCiplak @TobiasLins 是的,原来我错过了处理
AppDelegate.m中的Univeral Links的几行代码,我现在已将应用程序部署到生产环境。我已经用下面的代码回答了 -
顺便说一句,我找到了一个链接希望有人帮助config9.com/apps/firebase/…
标签: ios react-native firebase-dynamic-links react-native-firebase