简体   繁体   中英

Authentication is required. You need to sign into your Google Account in phonegap

i am integrated in app purchase i am getting these error

在此处输入图片说明

This is my config file

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

and my index.html file

    <!DOCTYPE HTML>
<html>
    <head>
        <title>In App Billing</title>
        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
        <script type="text/javascript" charset="utf-8" src="inappbilling.js"></script>
        <script type="text/javascript" charset="utf-8">
            function successHandler (result) {
                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
                inappbilling.init(successHandler, errorHandler, {showLog:true};
            }

            // 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>

    </head>
    <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>
    </body>
</html>

above index.html shows all integration plugin. i am integrating these app in build.phonegap.com.

and my product id is

在此处输入图片说明

Please help me where i am did mistack and how to solve these.For testing app in beta Still faceing these issues.

In my case, I did not publish app on play it was in draft then I publish it in alpha testing and created test user with my tester Gmail account (separate account than developer account) and add it in some google group then click on the 'BECOME A TESTER' button to opt-in through that tester link by following the instruction on this blog. After 2, 3 hours of publishing, it was working fine.

Follow the instructions on this blog:

http://help.gamesalad.com/gamesalad-cookbook/7-using-pro-features/7-03-adding-in-app-purchases-iap/7-03-2-setting-up-iap-for-google-play/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM