简体   繁体   English

Firebase电话号码身份验证错误

[英]Firebase Phone number authentication Error

I am Using Firebase phone number login authentication All things are perfect 我正在使用Firebase电话号码登录身份验证一切都很完美

1) Provisioning profile 1)供应资料

2) certificate 2)证书

3) Signing methods Enable 3)签名方式启用

4) Project setting with .12 file 4)使用.12文件进行项目设置

5) everything should perfect 5)一切都应该完美

Issue When I send mobile number for the OTP using thins method using this code 当我使用此代码使用Thins方法发送OTP手机号码时出现问题

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 . 看来您没有使用-ObjC链接器标志链接您的应用程序,这是不使用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. setFir_authPhoneNumber:被实现为一个类别 ,因此必须使用-ObjC链接器标志,否则库中编译的.o将不会链接到您的应用程序二进制文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase 认证:Swift 中的电话号码认证 - Firebase Authentication : Phone number authentication in Swift 在 Firebase 身份验证中更新电话号码 - Swift - Update Phone Number in Firebase Authentication - Swift 离子电容 Firebase 电话号码认证问题 - Ionic Capacitor Firebase Phone Number Authentication Problems 设备无法使用Firebase身份验证电话号码 - Device not working with Firebase Authentication Phone Number 是否可以在Firebase中使用电子邮件和电话号码进行身份验证? - Is it possible to use email and phone number to authentication in Firebase? Firebase 更新电子邮件和电话号码。 “此操作很敏感,需要最近的身份验证。” updateEmail ios swift 上的错误 - Firebase Update Email and Phone number. “this operation is sensitive and requires recent authentication.” Error on updateEmail ios swift Firebase 电话身份验证失败 - Firebase phone Authentication failes Google Firebase-某些电话上的电话身份验证结果错误 - Google Firebase - Phone Authentication results Error on some phones Flutter中的Firebase电话身份验证问题 - firebase phone authentication problem in flutter 使用电话号码的 Firebase 身份验证返回内部错误 - Firebase Auth using phone number returns an internal error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM