1.0.40 • Published 10 years ago

openiab-cordova-plugin-fortumo v1.0.40

Weekly downloads
13
License
MIT
Repository
github
Last release
10 years ago

OpenIAB-Cordova-Plugin

OpenIAB plugin for Cordova-based frameworks

Cordova Integration

1) Add Android platform to your project using CLI.

$ cordova platform add android

2) Add OpenIAB plugin, referencing repo.

$ cordova plugin add https://github.com/onepf/OpenIAB-Cordova-Plugin.git

3) Build the app.

$ cordova build

4) Run it.

$ cordova run android

Intel XDK Integration

Import plugin

Import settings

Import settings

Plugin Usage

1) Include script to your application.

<script type="text/javascript" src="cordova.js"></script>

2) Simply call openiab object methods, passing callback functions.

a) Map you SKUs. This step is optional.

openiab.mapSku(function(){}, function(error){}, SKU1, openiab.STORE_NAME.GOOGLE, "sku_product");

b) Set some options.

Set store search strategy.

openiab.options.storeSearchStrategy = openiab.STORE_SEARCH_STRATEGY.INSTALLER_THEN_BEST_FIT;

Set available stores to restrict the set of stores to check.

openiab.options.availableStoreNames = [ openiab.STORE_NAME.GOOGLE, openiab.STORE_NAME.YANDEX ];

Set preferred store names (works only for store search strategy OpenIabHelper.Options.SEARCH_STRATEGY_BEST_FIT and OpenIabHelper.Options.SEARCH_STRATEGY_INSTALLER_THEN_BEST_FIT).

openiab.options.preferredStoreNames = [ openiab.STORE_NAME.GOOGLE, openiab.STORE_NAME.YANDEX ];

Set store keys.

openiab.options.storeKeys = [ [openiab.STORE_NAME.GOOGLE, 'your public key'] ];

Set verifying mode (applicable only for Google Play, Appland, Aptoide, AppMall, SlideMe, Yandex.Store).

openiab.options.verifyMode = openiab.VERIFY_MODE.SKIP;

c) Initialize plugin.

openiab.init(function(){}, function(error){}, [ "SKU1", "SKU2", "SKU3" ]);

d) Start purchase.

openiab.purchaseProduct(function(purchase){}, function(error){}, "SKU");

e) Consume consumable SKUs in order to be able to purchase it again.

openiab.consume(function(purchase){}, function(error){}, "SKU");

3) Use additional methods to get information about SKUs and purchases.

a) Can be used any time after init is finished.

openiab.getPurchases(function(purchaseList){}, function(error){});

b) Get details of the single SKU.

openiab.getSkuDetails(function(skuDetails){}, function(error){}, "SKU");

c) Get details of the SKU list.

openiab.getSkuListDetails(function(skuDetailsList){}, function(error){}, ["SKU1", "SKU2", "SKU3"]);

Also consider to check sample application for cordova or xdk.

Data Structures

purchase =
{
    itemType:'',
    orderId:'',
    packageName:'',
    sku:'',
    purchaseTime:0,
    purchaseState:0,
    developerPayload:'',
    token:'',
    originalJson:'',
    signature:'',
    appstoreName:''
}

skuDetails =
{
  	itemType:'',
    sku:'',
    type:'',
    price:'',
    title:'',
    description:'',
    json:''
}

error =
{
    code:-1,
	message:''
}
1.0.40

10 years ago

1.0.39

10 years ago

1.0.38

10 years ago

1.0.37

10 years ago

1.0.36

10 years ago

1.0.35

10 years ago

1.0.34

10 years ago

1.0.33

10 years ago

1.0.32

10 years ago

1.0.31

10 years ago

1.0.30

10 years ago

1.0.29

10 years ago

1.0.28

10 years ago

1.0.27

10 years ago

1.0.26

10 years ago

1.0.25

10 years ago

1.0.24

10 years ago

1.0.23

10 years ago

1.0.22

10 years ago

1.0.21

10 years ago

1.0.20

10 years ago

1.0.19

10 years ago

1.0.18

10 years ago

1.0.17

10 years ago

1.0.16

10 years ago

1.0.15

10 years ago

1.0.14

10 years ago

1.0.13

10 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago