我们正在尝试为CardIO www.card.io) CardIO(5.4.1)创建一个本地脚本插件(IOS):
Pod被下载得很好。当我们检查XCODE项目时,Cardio pod被添加,库和*.h文件被添加得很好。
当我们运行项目时,我们无法调用CardIO库中的任何函数。我们假设库中的任何函数都不会为javascript公开。
JavaScript错误:
file:///app/tns_modules/nativescript-cardio/cardio.js:3:57: JS错误ReferenceError:找不到变量: 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);
}
}发布于 2017-04-25 19:23:02
我今天对此进行了研究,并得出结论,CardIO目前与NativeScript不兼容。它不经常发生,但有时会发生。
好消息是,您可以利用Podfile的资产,自己创建一个(在本例中)静态框架,该框架可以很好地暴露在NativeScript中。
在这种情况下,还有一些挑战(例如,三个.a文件而不是一个)。
这是一个太多(过程和代码)在这里解释,所以我宁愿添加一些代码到一个GitHub回购,并链接到从这个问题。
如果你需要我的帮助,你能给我发邮件(eddyverbruggen在gmail网站)吗?
https://stackoverflow.com/questions/43610017
复制相似问题