【问题标题】:Firebase Phone number authentication ErrorFirebase 电话号码身份验证错误
【发布时间】:2017-07-05 09:49:18
【问题描述】:

我正在使用 Firebase 手机号登录认证 一切都很完美

1) 配置文件

2) 证书

3) 签名方法启用

4) .12 文件的项目设置

5) 一切都应该完美

问题 当我使用此代码使用 Thins 方法发送 OTP 的手机号码时

NSString *phoneNumber = @"+919428936703";

[[FIRPhoneAuthProvider provider]
 verifyPhoneNumber:phoneNumber
 completion:^(NSString * verificationID,
              NSError * error) {

     NSLog(@"VARIFICATION CODE %@", verificationID);
     NSLog(@"Error %@", error);

     if (!error){


     }else{

     }
 }];

也获取调用方法

- (void)application:(UIApplication *)application
didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    // Pass device token to auth.
    [[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeSandbox];

}

- (void)application:(UIApplication *)application
didReceiveRemoteNotification:(NSDictionary *)notification
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {

    NSLog(@"DATA OF AUTH %@", [FIRAuth auth]);

    if ([[FIRAuth auth] canHandleNotification:notification]) {

        NSLog(@"Handle by Firebase ");

        completionHandler(UIBackgroundFetchResultNoData);
        return;
    }else{
        NSLog(@"NOT HANDLE BY FIREBASE %@", notification);
    }
}

但在出现此错误日志后发生崩溃

-[__NSCFString setFir_authPhoneNumber:]: unrecognized selector sent to instance 0x166388b0

【问题讨论】:

    标签: ios objective-c firebase firebase-authentication


    【解决方案1】:

    您似乎没有使用-ObjC 链接器标志链接您的应用,这是Integrate without CocoaPods 说明的一部分。

    setFir_authPhoneNumber: 实现为category,因此必须使用-ObjC 链接器标志,否则从库中编译的.o 将不会链接到您的应用二进制文件中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-01-28
      • 1970-01-01
      • 1970-01-01
      • 2019-11-03
      • 2018-01-19
      • 2018-02-21
      • 2021-04-03
      相关资源
      最近更新 更多