0.0.5 • Published 11 days ago

cordova-swifty-iap-plugin v0.0.5

Weekly downloads
5
License
MIT
Repository
github
Last release
11 days ago

SwiftyIAP

This is an iOS cordova plugin based on SwiftyStoreKit to manage in-app purchases

⚠️ This plugin can do only some basic tasks, we have not included all functionalities that SwiftyStoreKit has yet.

✅️ Pull Requests and any kind of feedback are very much appreciated.

Installation

You can add the plugin by running the following command in your Cordova folder.

cordova plugin add cordova-swifty-iap-plugin

Basic Usage

// completeTransactions must be run once after the app is started
SwiftyIAP.completeTransactions()

// Retrieving the product details from App Store
SwiftyIAP.retrieveProductsInfo(['com.example.productId'],products => console.log(products), error => console.log(error))

// Making a purchase
SwiftyIAP.purchaseProduct('com.example.productId', result => console.log(result), error => console.log(error)))

// Getting a receipt
SwiftyIAP.fetchReceipt(forced, result => console.log(result), error => console.log(error)))

// Restoring purchases
SwiftyIAP.restorePurchases(result => console.log(result), error => console.log(error)))

Typescript Support

The type definitions are available within this package. You can use them by simply installing the package in your typescript project.

npm install cordova-swifty-iap-plugin

After installing the package, you can use the types by adding a reference to them in your project

// foo.ts

/// <reference types="cordova-swifty-iap-plugin" />


let products: CordovaPlugin.SwiftyIAP.Product[]
0.0.5

11 days ago

0.0.4

1 year ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago