我正在使用 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
最佳答案
看起来您没有将您的应用与 -ObjC
链接器标志链接,这是 Integrate without CocoaPods 说明的一部分.
setFir_authPhoneNumber:
实现为 category ,因此必须使用 -ObjC
链接器标志,否则库中编译的 .o
将不会链接到您的应用程序二进制文件中。
关于ios - Firebase 电话号码身份验证错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44922710/