我们正在尝试为CardIO创建nativescript插件(IOS)www.card.io) CardIO(5.4.1) :用于CardIO的Nativescript插件(IOS) - 无法调用CARDIO库中的任何函数并且未公开
- 下载nativescript-插件种子(https://github.com/NathanWalker/nativescript-plugin-seed)
- 执行的所有预requesties的种子。
- 新增podFile在平台(POD '心',:git的=> 'https://github.com/card-io/card.io-iOS-SDK.git')
- 修改CardIO.ios.ts调用函数的心库
荚是越来越好下载中。当我们检查XCODE项目时,Cardio pod被添加,并且库和* .h文件被添加为GOOD。
当我们运行该项目时,我们无法调用CardIO库中的任何函数。我们假设库中的函数都没有公开给javascript。
JavaScript错误:
file:///app/tns_modules/nativescript-cardio/cardio.js:3:57: JS ERROR ReferenceError: Can't find variable: CardIOPaymentViewController
请找到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);
}
}
请提供一些代码,以便更好地了解您的问题 – bisma