We are trying to create a nativescript plugin(IOS) for CardIO www.card.io) CardIO(5.4.1):
- downloaded nativescript-plugin-seed (https://github.com/NathanWalker/nativescript-plugin-seed)
- Performed all pre-requesties for the seed.
- Added podFile in platform (pod 'CardIO', :git=> 'https://github.com/card-io/card.io-iOS-SDK.git')
- Modified CardIO.ios.ts to call the functions in the CardIO Library
The Pod is getting downloaded good. When we checked the XCODE project the Cardio pod is added and the library and *.h files are added GOOD.
When we run the project we are not able to call any of the functions in the CardIO library. We assume that none of the functions in the library is exposed for javascript.
JavaScript error:
file:///app/tns_modules/nativescript-cardio/cardio.js:3:57: JS ERROR ReferenceError: Can't find variable: CardIOPaymentViewController
Please find the code in cardio.ios.ts
export var scanCardClicked = function () {
// var CardIOPaymentViewController=new CardIOPaymentViewController();
let scanViewController = CardIOPaymentViewController.alloc().initWithPaymentDelegate(this);
scanViewController.modalPresentationStyle = UIModalPresentationFormSheet;
this.presentViewControllerAnimatedCompletion(scanViewController, 1, null);
}
class CardIOPaymentViewControllerDelegateImpl extends NSObject implements CardIOPaymentViewControllerDelegate {
userDidProvideCreditCardInfoInPaymentViewController(info: CardIOCreditCardInfo, paymentViewController: CardIOPaymentViewController)
{this.dismissViewControllerAnimatedCompletion(1, null);
//this.infoLabel.test = "Received Card: " + info.redactedCardNumber + "Expiry:" + info.expiryMonth + "/" + info.expiryYear + "CVV:" + info.cvv;
}
userDidCancelPaymentViewController(paymentViewController: CardIOPaymentViewController)
{
this.dismissViewControllerAnimatedCompletion(1, null);
}
}