简体   繁体   中英

Firebase Phone number authentication Error

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM