[英]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.