Apple Wallet

Contents

A Cordova plugin that enables users from Add Payment Cards to their Apple Wallet.

https://github.com/tomavic/cordova-apple-wallet

Stuck on a Cordova issue?

Installation

Community Enterprise
ionic cordova plugin add cordova-apple-wallet npm install @ionic-native/apple-wallet
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More   or   Contact Us
ionic activate-native-ee --key=YOURPRODUCTKEY ionic integrations add @ionic-native/apple-wallet

Supported Platforms

  • iOS

Usage

import { AppleWallet } from '@ionic-native/apple-wallet/ngx';


constructor(private appleWallet: AppleWallet) { }

...


this.appleWallet.available()
 .then((res) => {
   // res is a boolean value, either true or false
   console.log("Is Apple Wallet available? ", res);
  })
 .catch((message) => {
   console.error("ERROR AVAILBLE>> ", message);
 });

...

let data: cardData = {
   cardholderName: 'Test User',
   primaryAccountNumberSuffix: '1234',
   localizedDescription: 'Description of payment card',
   paymentNetwork: 'VISA'
 }

this.appleWallet.startAddPaymentPass(data: cardData)
 .then((res) => {
   console.log("startAddPaymentPass success response ", res);
  })
 .catch((err) => {
   console.error("startAddPaymentPass ERROR response", err);
 });

...

let data: encryptedCardData = {
   activationData: 'encoded Base64 activationData from your server',
   encryptedPassData: 'encoded Base64 encryptedPassData from your server',
   wrappedKey: 'encoded Base64 wrappedKey from your server',
 }

this.appleWallet.encryptedCardData(data: encryptedCardData)
 .then((res) => {
   console.log("completeAddCardToAppleWallet success response ", res);
  })
 .catch((err) => {
   console.error("completeAddCardToAppleWallet ERROR response", err);
 });