Firebase电话号码身份验证错误 [英] Firebase Phone number authentication Error

查看:253
本文介绍了Firebase电话号码身份验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Firebase的电话号码登录身份验证所有的东西都是完美的
$ b $ 1配置文件

2 )证书
$ b 3)签名方法启用

4)使用.12文件的项目设置$ /

5)一切都应该是完美的

发行
当我发送移动号码的OTP使用thins方法使用这个代码

  NSString * phoneNumber = @+ 919428936703; 
$ b $ [FIRPhoneAuthProvider provider]
verifyPhoneNumber:phoneNumber
completion:^(NSString * verificationID,
NSError * error){

NSLog (@VARIFICATION CODE%@,verificationID);
NSLog(@Error%@,error);如果(!错误){


} else {


}];

;

同样获得调用方法

($ application):(UIApplication *)application 
didRegisterForRemoteNotificationsWithDeviceToken :( NSData *)deviceToken {
//将设备令牌传递给auth。
[[FIRAuth auth] setAPNSToken:deviceToken type:FIRAuthAPNSTokenTypeSandbox]; (void)($)


$ (UIBackgroundFetchResult))completionHandler {

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

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

NSLog(@Firebase处理);

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






$ b

但是在得到这个错误日志崩溃之后, / p>

   -  [__ NSCFString setFir_authPhoneNumber:]:发送到实例的无法识别的选择器0x166388b0 


解决方案

看起来你并没有将你的应用与 -ObjC 链接器标记,这是不使用CocoaPods进行集成的说明的一部分。



setFir_authPhoneNumber:实现为 category ,因此 -ObjC 链接器标志必须被使用,或者编译后的 .o 不会被链接到你的应用程序二进制文件中。


I am Using Firebase phone number login authentication All things are perfect

1) Provisioning profile

2) certificate

3) Signing methods Enable

4) Project setting with .12 file

5) everything should perfect

Issue When I send mobile number for the OTP using thins method using this code

NSString *phoneNumber = @"+919428936703";

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

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

     if (!error){


     }else{

     }
 }];

Also get call methods

- (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);
    }
}

but then after getting a crash with this error log

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

解决方案

It looks like you're not linking your app with -ObjC linker flag, which is part of the instructions for Integrate without CocoaPods.

setFir_authPhoneNumber: is implemented as a category, thus -ObjC linker flag must be used or the compiled .o from the library won't be linked into your app binary.

这篇关于Firebase电话号码身份验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆