Face ID on codename one with biometry Type

39 views
Skip to first unread message

yassine...@gmail.com

unread,
Dec 25, 2017, 11:19:33 AM12/25/17
to CodenameOne Discussions
 Hello,

i'm trying to integrate Face Id on my IOS app , then to achieve that i used the native interface using the LocalAuthentication framework, the problem founded existe on the function that check the type of the biometry used natively on the IOS device ''biometryType',
unfortunately, the xcode that you are using doesn't support the new LocalAuthentication framework based on xcode 9.x .


that's my code : 


  LAContext *laContext = [[LAContext alloc] init];

    NSError *error1 = nil;

    NSString *stringToReturn = nil;

    

    if (@available(iOS 8.0, *)) {

        

        NSError *authError = nil;

        BOOL isCanEvaluatePolicy = [laContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&authError];

        

        

        if (isCanEvaluatePolicy) {

            if (@available(iOS 11.0, *)) {

                switch (laContext.biometryType) {

                    case LABiometryTypeNone:

                    {

                        stringToReturn=@"NONE";

                    }

                        break;

                    case LABiometryTypeTouchID:

                    {

                        stringToReturn=@"TOUCHID";

                    }

                        break;

                    case LABiometryTypeFaceID:

                    {

                        stringToReturn=@"FACEID";

                    }

                        break;

                    default:

                        break;

                }

            } else {

                stringToReturn=@"TOUCHID";

            }

            

        } else {

            stringToReturn=@"NONE";

        }

        

        

    } else {

        // Fallback on earlier versions

        stringToReturn=@"NONE";

    }

    


please help!!

thanks in advance.

Shai Almog

unread,
Dec 26, 2017, 12:02:49 AM12/26/17
to CodenameOne Discussions
Hi,
we are currently in the process of adding xcode 9.2 support which will make this easier. To do this we need to update the OS in all the servers which caused the recent regression with build failures due to timeout...

We resolved that so we'll continue the update process soon. It might be a bit slower as we do it one server at a time and we need support staff to be available which is problematic due to the holiday.

This should be around for January at which point we'll post instructions on how to toggle the xcode version you compile against. Notice it will still be experimental as xcode 9 broke a few things such as push/notifications and has made some other things harder e.g. permissions now require special build hints.

If you need to do this now you can compile a static library on xcode 9 and integrate it.

yassine...@gmail.com

unread,
Dec 26, 2017, 4:45:04 AM12/26/17
to CodenameOne Discussions
Thanks Shai for that detailed explination, i would like to notice according to my experiance to submit the generated version on the appstore you need to add the following things:

  • The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.
  • The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
  • Enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file.
  • iOS Apps must include a 1024x1024px App Store Icon in PNG format.

i'll try to use the static library and come back to you,

thank's,
regards

Shai Almog

unread,
Dec 27, 2017, 12:18:02 AM12/27/17
to CodenameOne Discussions
We already support a 1024 icon and all the NS descriptions using build hints. You don't need push for submission.
If you use Application Loader none of these are needed. They are only needed if you use xcode 9.x.
Reply all
Reply to author
Forward
0 new messages