Firebase 动态链接不适用于本机反应中的 iOS
Firebase Dynamic Links is not working for iOS in react-native
我已经为我的 react-native 应用程序设置了无密码身份验证,因为它需要设置 firebase 动态 links,我成功了。
在 Android 和 iOS 平台上一切正常,但在我将我的分支与主分支合并后,它停止在 iOS 上工作。
这意味着我收到了 SignIn 的电子邮件,但是 link 没有打开 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 和我的特定 App 的 Apple 开发者帐户中
已将 TeamID 添加到 Firebase 控制台作为 appID 前缀。
添加了这些 Firebase 授权域:
applinks:realyze.page.link
activitycontinuation:realyze.page.link
还将域添加到权利文件
6.app-站点关联文件也已正确设置
在我合并我的分支之前,这个设置对我有用。
非常感谢您的帮助。
谢谢。
我在 AppDelegate.m
中添加了以下代码行:
//Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
这对我有用,我现在已经部署了 Beta 版应用程序
我已经为我的 react-native 应用程序设置了无密码身份验证,因为它需要设置 firebase 动态 links,我成功了。
在 Android 和 iOS 平台上一切正常,但在我将我的分支与主分支合并后,它停止在 iOS 上工作。 这意味着我收到了 SignIn 的电子邮件,但是 link 没有打开 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 和我的特定 App 的 Apple 开发者帐户中
已将 TeamID 添加到 Firebase 控制台作为 appID 前缀。
添加了这些 Firebase 授权域: applinks:realyze.page.link activitycontinuation:realyze.page.link
还将域添加到权利文件
6.app-站点关联文件也已正确设置
在我合并我的分支之前,这个设置对我有用。
非常感谢您的帮助。
谢谢。
我在 AppDelegate.m
中添加了以下代码行:
//Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
这对我有用,我现在已经部署了 Beta 版应用程序