相关疑难解决方法(0)

SwiftUI 应用生命周期 iOS14 AppDelegate 代码放在哪里?

现在,AppDelegateSceneDelegate从SwiftUI删除,你在哪里我把我以前在代码SceneDelegateAppDelegate,火力地堡配置为前?

所以我目前在我的代码中有这个代码AppDelegate

我现在应该把这段代码放在哪里?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    
    FirebaseConfiguration.shared.setLoggerLevel(.min)
    FirebaseApp.configure()
    return true
}
Run Code Online (Sandbox Code Playgroud)

ios firebase swiftui ios14 xcode12

74
推荐指数
4
解决办法
2万
查看次数

Firebase Phone身份验证无法获取远程通知注册

目前正在努力应对日志中出现的以下错误:

<Error> [Firebase/Auth][I-AUT000015] The UIApplicationDelegate must handle remote notifcation for phone number authentication to work.

调用时以及此NSError对象verifyPhoneNumber:completion::

@"NSLocalizedDescription" : @"If app delegate swizzling is disabled, remote notifications received by UIApplicationDelegate need to be forwarded to FIRAuth's canHandleNotificaton: method." @"error_name" : @"ERROR_NOTIFICATION_NOT_FORWARDED"

任何人都知道这是关于什么以及如何解决它?

我正在使用XCode 8.3.3,Firebase 4.0.0,我已经关闭了swizzling,我已经确认我成功注册了APNS(我看到令牌)和FCM(我也看到了这一点).

我在文档和iOS云消息github sample repo中都使用了示例代码.

在尝试将Firebase集成到同一个项目之前,我让Digits手机验证工作完美无缺,并且推送来自AWS SNS和OneSignal的通知.

与Firebase相关的部分的相关代码:

AppDelegate中

+ (void)initialize
{

    FIROptions *firOptions = [[FIROptions alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"some-plist-name" ofType:@"plist"]];
    [FIRApp configureWithOptions:firOptions];
}


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [FIRMessaging messaging].delegate = self;
    [FIRMessaging messaging].shouldEstablishDirectChannel …
Run Code Online (Sandbox Code Playgroud)

ios firebase firebase-authentication firebase-cloud-messaging

4
推荐指数
1
解决办法
2861
查看次数