CardIO www.card.io) CardIO(5.4.1) 用のネイティブ スクリプト プラグイン (IOS) を作成しようとしています。
- ダウンロードした nativescript-plugin-seed ( https://github.com/NathanWalker/nativescript-plugin-seed )
- シードのすべての事前リクエストを実行しました。
- プラットフォームに podFile を追加 (pod 'CardIO', :git=> ' https://github.com/card-io/card.io-iOS-SDK.git ')
- CardIO ライブラリの関数を呼び出すように CardIO.ios.ts を変更しました。
Pod は正常にダウンロードされています。XCODE プロジェクトを確認すると、Cardio ポッドが追加され、ライブラリと *.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);
}
}