0
votes

I created a Xamarin Binding Library project to map the card connect sdk for ios and was successful in it. But when I try to create a sample project to test the function its giving me the following error.

Could not create an native instance of the type 'CardConnect.CCCPaymentRequest': the native class hasn't been loaded. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.

You can find the Objective C & Swift sample and documentation in the link below https://developer.cardconnect.com/mobile-sdks#iOS

I've shared the binding library project and the necessary SDK framework in Github

1
This suggests the native library in question has not been loaded.You can refer this documentation:developer.xamarin.com/guides/ios/advanced_topics/native_interopLucas Zhang
@LucasZhang-MSFT I am trying to bind an Objective C framework library, the link talks about static library.Anand

1 Answers

0
votes

I am posting the solution I got after multiple communications with card connect team and microsoft support team.

The working solution is updated in Github: Card Connect SDK Binding

There are couple of points to be noted while anyone is going to utilize this,

  • Specifying the properties of the native library, you need to set the below items

    Force Load : selected
    Linker flags: -lxml2
    Smart Link : selected

  • Setting the Additional mtouch flag where you use it, follow the below steps,

    => choose “options” at the bottom => find “iOS Build” => find a text input box called “Additional mtouch arguments”, then add the follow script “--optimize=-remove-dynamic-registrar”

  • Adding the merchant id in the Entitements.plist where you use the card connect library.

Note: You can test the sample using apple pay sandbox account for that you need an apple developer account & apple itunes/appstoreconnect account, with that you need to create the certificate mentioning the apple pay capability and create a provisioning profile with that certificate and the devices you intend to test. Then sign your test application with the provisioning profile and load it in your iOS device either via Diawi.com or any other testing service. You should be good to verify your solution.