npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@orange-games/cordova-plugin-pxinapp

v0.0.5

Published

[email protected]:orange-games/cordova-plugin-pxinapp.git

Downloads

4

Readme

cordova-plugin-pxinapp

Cordova plugin for PXInApp SDK

Supported platforms

Android only

Installation

cordova plugin add cordova-plugin-pxinapp --save

Usage

Config and setup

Pixtel will supply a special bin config file that contain the products for your app. This bin file needs to be placed in the root folder of your cordova project. This plugin will automaticly place it in the correct folder of the resulting APK.

After that you can initialize with 3 parameters:

window.pxInApp.setup(
    '321587236bv587936b50234go2w438h',  //The account ID you recveived from Pixtel
    2,                                              // The UI mode, 0 = game ui, 2 = sdk UI, 1 = hybrid
    true                                            //Boolean for test mode
 ).then((result) => {
    document.getElementById('data-box').innerHTML = result;
    console.log('Success!', result)
}).catch((e) => {
    document.getElementById('data-box').innerHTML = 'Error: ' + e;

    console.log('error!', e)
});

the setup function returns a Promise that will be resolved if the PXInapp library is correctly initialized

List products

The API is very straight forward. You should already know the product ID's at forehand because they've been discussed with Pixtel before you got the bin config file. After that you can just fetch the product like so:

window.pxInApp.fetchProduct(1) //Fetch product with id 1
    .then(JSON.parse)
    .then(function (result) {
        document.getElementById('data-box').innerHTML = result;
        console.log('fetch success!');

        console.log(result);
    })
    .catch(function (error) {
        document.getElementById('data-box').innerHTML = 'Error: ' + error;
        console.log('fetch error!');

        console.log(error);
    });

On success, an object will be returned including, but not limited to, the following properties:

  • price_amount Formatted string amount
  • description Product description

Make a purchase

The following function allows you to buy the specified product and will return a promise similar to fetchProduct

window.pxInApp.buyProduct(1)
    .then(JSON.parse)
    .then(function (result) {
        document.getElementById('data-box').innerHTML = result;
        console.log('buy success!');
        console.log(result);
    })
    .catch(function (error) {
        document.getElementById('data-box').innerHTML = 'Error: ' + error;
        console.log('buy error!');

        console.log(error);
    });