AndroidInAppBilling icon indicating copy to clipboard operation
AndroidInAppBilling copied to clipboard

working with a links

Open vi1804 opened this issue 10 years ago • 1 comments

I am developing an android phonegap application and I want to use in app billing in it. I installed the phonegap billing plugin and it works perfectly. Can anyone help me make it work correct with a links for example:

<a href="good.html" id='good' data-ignore="true">Good</a>

Thats after clicking on a link first of all i ll be able to pay or check if a good is already bought before linking to a page. Thanks.

vi1804 avatar May 16 '14 07:05 vi1804

You'll need to use JavaScript to capture the link click event and then wait for the plugin callback. It might look something like this (with jQuery):

function onSuccess() {
    //link to your other page on success
    document.location.href = 'your-link';
}

function onFail() {
    //handle buying errors here
}

$('#good').click(function() {
    inappbilling.buy(onSuccess, onFail, 'your-product-id');
});

mcfarljw avatar May 22 '14 23:05 mcfarljw