iink SDK on Device

Answered

Error: invalid certificate

Hi,

I get invalid certificate in iOS swift project, I'm sure that I'm passing the correct certificate, I have confirmed by using the same in certificate in demo application and it is working fine.

below is my code 

  

if myCertificate.length == 0 {
            print("Please replace the content of MyCertificate.c with the certificate you received from the developer portal")
        }

        let data = Data(bytes: myCertificate.bytes, count: myCertificate.length)


        guard let engine = IINKEngine(certificate: data) else {
            print("Invalid certificate")
            return
        }

 

Would be great for any help.


Best Answer

Dear Kishore,


currently, several things in your post:

-First, why do you need to have the "use_frameworks!"? Indeed, since cocoapod 1.5, it is no longer necessary: https://blog.cocoapods.org/CocoaPods-1.5.0/

-Then, althought you normally do not need the ""use_frameworks!", if you still want to manually add the libraries, ensure you add these in the proper order: https://developer-support.myscript.com/support/discussions/topics/16000030642

libMyScript2D.a
libMyScriptAnalyzer.a
libMyScriptDocument.a
libMyScriptGesture.a
libMyScriptInk.a
libMyScriptMath.a
libMyScriptPrediction.a
libMyScriptShape.a
libMyScriptText.a
libMyScriptEngine.a
libiink.a

-Last, when looking at your dashboard, I see you have the error message "Mismatch between certificate and application:" => This means the application identifier is not aligned with the certificate.

You shall properly follow the instructions provided on the developer portal documentation: https://developer.myscript.com/support/account/on-device-license-management/

In more details, here is the procedure to apply:

-Login to your ATK dashboard: https://atk.myscript.com/

-Select the “Create application” button

-Open the newly created app

-Create a certificate:

-And fill the Identifier field with yourpackage name, or bundle identifier of your application: https://developer.myscript.com/support/account/on-device-license-management/#applications

-A quick way to ensure it is properly set is by checking the console under your ATK dashboard:

Best regards,


Olivier


FYI: I have added all the libraries manually to the project, as I can't add a static library with use_frameworks! enabled

Answer

Dear Kishore,


currently, several things in your post:

-First, why do you need to have the "use_frameworks!"? Indeed, since cocoapod 1.5, it is no longer necessary: https://blog.cocoapods.org/CocoaPods-1.5.0/

-Then, althought you normally do not need the ""use_frameworks!", if you still want to manually add the libraries, ensure you add these in the proper order: https://developer-support.myscript.com/support/discussions/topics/16000030642

libMyScript2D.a
libMyScriptAnalyzer.a
libMyScriptDocument.a
libMyScriptGesture.a
libMyScriptInk.a
libMyScriptMath.a
libMyScriptPrediction.a
libMyScriptShape.a
libMyScriptText.a
libMyScriptEngine.a
libiink.a

-Last, when looking at your dashboard, I see you have the error message "Mismatch between certificate and application:" => This means the application identifier is not aligned with the certificate.

You shall properly follow the instructions provided on the developer portal documentation: https://developer.myscript.com/support/account/on-device-license-management/

In more details, here is the procedure to apply:

-Login to your ATK dashboard: https://atk.myscript.com/

-Select the “Create application” button

-Open the newly created app

-Create a certificate:

-And fill the Identifier field with yourpackage name, or bundle identifier of your application: https://developer.myscript.com/support/account/on-device-license-management/#applications

-A quick way to ensure it is properly set is by checking the console under your ATK dashboard:

Best regards,


Olivier