JSPM

  • Created
  • Published
  • Downloads 193
  • Score
    100M100P100Q102596F
  • License ISC

Purchasely is a solution to ease the integration and boost your In-App Purchases & Subscriptions on the App Store, Google Play Store, Amazon Appstore and Huawei App Gallery.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@purchasely/cordova-plugin-purchasely) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Cordova plugin Purchasely

    Purchasely is a solution to ease the integration and boost your In-App Purchase & Subscriptions on the App Store, Google Play Store and Huawei App Gallery.

    Installation

    cordova plugin add @purchasely/cordova-plugin-purchasely

    Usage

    Purchasely.startWithAPIKey(
        'API_KEY',
        ['Google'], // list of stores for Android, accepted values: Google, Huawei and Amazon
        null, // your user id
        Purchasely.LogLevel.DEBUG, // log level, should be warning or error in production
        Purchasely.RunningMode.full, // running mode
        (isConfigured) => {
            if(isConfigured) // you can use the SDK like display a paywall or make a purchase
        },
        (error) => {
            console.log(error);
        }
    );
    
    Purchasely.presentPresentationWithIdentifier(
        'my_presentation_id', // may be null
        'my_content_id', // may be null
        false, //display in fullscreen mode
        (callback) => {
            console.log(callback);
            if(callback.result == Purchasely.PurchaseResult.CANCELLED) {
                console.log("User cancelled purchased");
            } else {
                console.log("User purchased " + callback.plan.name);
            }
        },
        (error) => {
            console.log("Error with purchase : " + error);
        }
    );

    🏁 Documentation

    A complete documentation is available on our website https://docs.purchasely.com