Soomla IAB error while purchasing in Game on Andro

2019-07-24 11:54发布

问题:

im using unity 3d to make a simple game just for testing Google services, for Google play games services i use googleplayplugin and for iab the soomla plugin. i think all is configured rightly, i install and start the game on my nexus4 and login successfully . when i try to buy the thing i configured ("correctly"?) the play store popup comes up but there is my problem the popup comes with this message "Error Authentication is required. You must log in with your Google Account".

what am i missing?? im loosing hours on this, plz help. im sure,im logged in with my google profile because i see my name. here the line about the item im trying to buy

//i define the currency
public VirtualCurrency[] GetCurrencies() {
            return new VirtualCurrency[]{HEART};
        }
//the pack of currency that can be purchased
public VirtualCurrencyPack[] GetCurrencyPacks() {
            return new VirtualCurrencyPack[] {HEART_PACK};
    }
//
public const string HEART_ITEM_ID = "heart"; //in-game id
public const string HEART_PACK_PRODUCT_ID = "heart_1"; // the id on the play store

public static VirtualCurrency HEART = new VirtualCurrency(
    "HEART",        // name
    "",         // description
    HEART_ITEM_ID       // item id
    );

public static VirtualCurrencyPack HEART_PACK = new VirtualCurrencyPack(
    "1 heart",                                   // name
    "Add a heart.",                       // description
    "heart_1",                                   // item id
    1,                  // number of currencies in the pack
    HEART_ITEM_ID,                        // the currency associated with this pack
    new PurchaseWithMarket(HEART_PACK_PRODUCT_ID, 0.50)
    );

and i call to buy with

StoreInventory.BuyItem (IAPGoogle.HEART_PACK.ItemId);

回答1:

the code is good, the problem is on the Google developer console, in order to buy i must publish the apk ,even if it is a beta or Alpha, and after i can test with testers approved accounts.