【发布时间】: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