iOS Question [SOLVED] TouchID / FaceID Objective C error

Mike1970

Well-Known Member
Licensed User
Longtime User
Hi, i'm trying to change this objective C code:
B4X:
#If OBJC

#import <LocalAuthentication/LocalAuthentication.h>

-(void)TouchID :(NSObject*)handler :(NSString*)subnameok :(NSString*)subnamefail :(NSString*)reason
{
LAContext *myContext = [[LAContext alloc] init];
NSError *authError = nil;
NSString *myLocalizedReasonString = @"Used for quick and secure access to the test app";

if ([myContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError]) {
    [myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
                  localizedReason:myLocalizedReasonString
                            reply:^(BOOL success, NSError *error) {
            if (success) {
                [self.__c CallSubDelayed:self.bi :handler :(subnameok) :(reason)];
            } else {
                [self.__c CallSubDelayed2:self.bi :handler :(subnamefail) :(error.localizedDescription) :(reason)];
            }
        }];
} else {
[self.__c CallSubDelayed2:self.bi :handler :(subnamefail) :(authError.localizedDescription) :(reason)];

}
}
#End If


But i get this error:

B4X:
The following build commands failed:
    CompileC /Users/administrator/Documents/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_biometric.o /Users/administrator/Documents/UploadedProjects/<user id>/B4iProject/b4i_biometric.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
 

Mike1970

Well-Known Member
Licensed User
Longtime User
Ok, i understand now:
I had to put "CallSubDelayed2" and "CallSubDelayed3" insted of "CallSubDelayed" and "CallSubDelayed2"
 
Upvote 0
Top