首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CardIO的Nativescript插件(IOS) -无法调用心脏病库中的任何函数,也不公开

CardIO的Nativescript插件(IOS) -无法调用心脏病库中的任何函数,也不公开
EN

Stack Overflow用户
提问于 2017-04-25 11:57:05
回答 1查看 414关注 0票数 1

我们正在尝试为CardIO www.card.io) CardIO(5.4.1)创建一个本地脚本插件(IOS):

  1. 下载本地语言-插件-种子(https://github.com/NathanWalker/nativescript-plugin-seed)
  2. 执行对种子的所有预先要求。
  3. 在平台中添加podFile (pod 'CardIO',:git=> 'https://github.com/card-io/card.io-iOS-SDK.git')
  4. 修改CardIO.ios.ts以调用CardIO库中的函数

Pod被下载得很好。当我们检查XCODE项目时,Cardio pod被添加,库和*.h文件被添加得很好。

当我们运行项目时,我们无法调用CardIO库中的任何函数。我们假设库中的任何函数都不会为javascript公开。

JavaScript错误:

file:///app/tns_modules/nativescript-cardio/cardio.js:3:57: JS错误ReferenceError:找不到变量: CardIOPaymentViewController

请在cardio.ios.ts中找到代码

代码语言:javascript
复制
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);
    }
}
EN

回答 1

Stack Overflow用户

发布于 2017-04-25 19:23:02

我今天对此进行了研究,并得出结论,CardIO目前与NativeScript不兼容。它不经常发生,但有时会发生。

好消息是,您可以利用Podfile的资产,自己创建一个(在本例中)静态框架,该框架可以很好地暴露在NativeScript中。

在这种情况下,还有一些挑战(例如,三个.a文件而不是一个)。

这是一个太多(过程和代码)在这里解释,所以我宁愿添加一些代码到一个GitHub回购,并链接到从这个问题。

如果你需要我的帮助,你能给我发邮件(eddyverbruggen在gmail网站)吗?

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43610017

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档