Hello guys

Hello guys,

I am surfing problem when tring to wrap Objective-C APIs. I have followed the steps described here http://delphiworlds.com/2013/10/adding-other-ios-frameworks-to-the-sdk-manager/, unfortunately without any success. All the time I run the code I get the error message: "ObjectiveC LAContext class could not be found". Strange is that I can see the LocalAuthentication folder inside Embarcadero\Studio\SDKs\iPhoneOS10.0.sdk\System\Library\Frameworks.

I am trying to use Touch ID from my FireMonkey app, I got the wrapper from https://bitbucket.org/allesbeste/delphi-touchid-wrapper-for-delphi. Recently I have received a iPhone device to work with.

The code works nice when targeting the Simulator however for real devices it doesn't work I don't know what I am doing wrong :( Debugging the app I realized the LocalAuthentication module was not loaded even I adding it to the SDK Frameworks, the entire output is here https://gist.github.com/horaciojcfilho/365bd8d509e7fec43754e3036c0281d6.

The code is the following (https://gist.github.com/horaciojcfilho/b01ab2e4055ba013ba03fc00dc10c059):
unit iOSAPI.LocalAuthentication;

interface

uses
macAPI.ObjectiveC, iOSAPI.Foundation;

const
LAPolicyDeviceOwnerAuthenticationWithBiometrics = 1;

type
LAPolicy = Int32;

LAContextReply = procedure(success: Pointer; error: Pointer) of object;

LAContextClass = interface(NSObjectClass)
['{6AA41561-0BBC-495C-9ADE-CB38B5AB9305}']
end;

LAContext = interface(NSObject)
['{8F6B7D53-83A8-43D3-B6C2-116068C382CE}']
function canEvaluatePolicy(policy: LAPolicy; error: NSError) : Boolean; cdecl;
procedure evaluatePolicy(policy: LAPolicy; localizedReason: NSString; reply: LAContextReply); cdecl;
end;

TLAContext = class(TOCGenericImport)
end;

implementation

end.

http://delphiworlds.com/2013/10/adding-other-ios-frameworks-to-the-sdk-manager/

Comments

Post a Comment