Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use InAppBilling plugin with remote phonegap build @ build.phonegap.com #96

Open
equry opened this issue May 9, 2015 · 3 comments

Comments

@equry
Copy link

equry commented May 9, 2015

Hi,
is it possible to use this pluggin with phonegap remote build, if yes please share the steps how?

if no, please share how to add this to an existing remote phone gap project.

here is my project,

  1. i have a single html file like following and config file has this setting
<gap:plugin name="com.smartmobilesoftware.inappbilling" version="3.0.2" />
<!DOCTYPE html>
<html>
<body>
        <h1>Hello World</h1>
        <button onclick="init()">Initalize the billing plugin</button>
        <button onclick="buy()">Purchase</button>
        <button onclick="ownedProducts()">Owned products</button>
        <button onclick="consumePurchase()">Consume purchase</button>
        <button onclick="subscribe()">Subscribe</button>
        <button onclick="getDetails()">Query Details</button>
        <button onclick="getAvailable()">Get Available Products</button>
<script>
    function successHandler (result) {
        alert('successhandler');
        var strResult = "";
        if(typeof result === 'object') {
            strResult = JSON.stringify(result);
        } else {
            strResult = result;
        }
        alert("SUCCESS: \r\n"+strResult );
    }

    function errorHandler (error) {
        alert("ERROR: \r\n"+error );
    }

    // Click on init button
    function init(){
        // Initialize the billing plugin
        //myOwnKeyRSABase64App FROM GOOGLE DEVELOPERS CONSOLE
        inappbilling.init(successHandler, errorHandler, {showLog:true, key: 'myOwnKeyRSABase64App'});
    }

    // Click on purchase button
    function buy(){
        // make the purchase
        inappbilling.buy(successHandler, errorHandler,"gas");
    }

    // Click on ownedProducts button
    function ownedProducts(){
        // Initialize the billing plugin
        inappbilling.getPurchases(successHandler, errorHandler);

    }

    // Click on Consume purchase button
    function consumePurchase(){
        inappbilling.consumePurchase(successHandler, errorHandler, "gas");
    }

    // Click on subscribe button
    function subscribe(){
        // make the purchase
        inappbilling.subscribe(successHandler, errorHandler,"infinite_gas");

    }

    // Click on Query Details button
    function getDetails(){
        // Query the store for the product details
        inappbilling.getProductDetails(successHandler, errorHandler, ["gas","infinite_gas"]);

    }

    // Click on Get Available Products button
    function getAvailable(){
        // Get the products available for purchase.
        inappbilling.getAvailableProducts(successHandler, errorHandler);
    }
</script>

</body>
</html>
@jamminjames
Copy link

I would like to get info on this as well. If it can be installed via the remote Phonegap Build, that would be awesome.

@YodasWs
Copy link

YodasWs commented Jun 16, 2015

You guys need to either switch to a fork of this plugin:

<gap:plugin name="com.mcm.plugins.androidinappbilling" version="3.0.6" />

or add your BILLING_KEY:

<gap:plugin name="com.smartmobilesoftware.inappbilling">
    <param name="BILLING_KEY" value="MIIBIjANBgk...AQAB" />
</gap:plugin>

@jamminjames
Copy link

Thanks for the reply, YodasWs. So, am I to understand that if I use <gap:plugin name="com.mcm.plugins.androidinappbilling" version="3.0.6" /> in the config.xml file, PhoneGap Build will install the plugin in such a way as to solve the problem with Google Play? Where does the billing key go in that case?

Do we include the info in the plugin.xml file manually anywhere in a PhoneGap Build install, or does that happen automatically? I notice there's a spot for the billing key in that file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants