1

CardIO www.card.io) CardIO(5.4.1) 用のネイティブ スクリプト プラグイン (IOS) を作成しようとしています。

  1. ダウンロードした nativescript-plugin-seed ( 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 ライブラリの関数を呼び出すように 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);
    }
}
4

1 に答える 1

1

今日これを調べたところ、CardIO は現在 NativeScript と互換性がないと結論付けなければなりませんでした。頻繁に起こるわけではありませんが、時々起こります。

良いニュースは、Podfile のアセットを取得して、NativeScript に問題なく公開できる (この場合) 静的フレームワークを自分で作成できることです。

ただし、この場合、さらにいくつかの課題があります (たとえば、1 つではなく 3 つの .a ファイル)。

ここで説明するのは (手順とコード) 多すぎるので、コードを GitHub リポジトリに追加し、この問題からそれにリンクしたいと思います。

私の支援が必要な場合は、私 (gmail dot com の eddyverbruggen) にメールを送信していただけますか?

于 2017-04-25T19:23:02.590 に答える