Reputation: 1
Here is an Asset class:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Soomla.Store;
public class StoreAssets : Soomla.Store.IStoreAssets {
public int GetVersion() {
return 0;
}
public VirtualCurrency[] GetCurrencies() {
return new VirtualCurrency[]{MW_ITEM};
}
public VirtualGood[] GetGoods() {
return new VirtualGood[] {};
}
public VirtualCurrencyPack[] GetCurrencyPacks() {
return new VirtualCurrencyPack[] {MW_ITEM1,MW_ITEM2,MW_ITEM3};
}
public VirtualCategory[] GetCategories() {
return new VirtualCategory[]{};
}
public NonConsumableItem[] GetNonConsumableItems() {
return new NonConsumableItem[]{};
}
public const string ITEMID = "mw_coin";//**NOT GOOGLE PLAY PRODUCT ID**
public const string FIFTY_COINS = "mw1";//**google play store product id**
public const string ONEFIFTY_COINS = "mw2";//**google play store product id**
public const string THREEHUNDRED_COINS = "mw3";//**google play store product id**
public static VirtualCurrency MW_ITEM = new VirtualCurrency ("Coins", "", ITEMID);
public static VirtualCurrencyPack MW_ITEM1 = new VirtualCurrencyPack("Buy 50 Coins",
"Use 50 coins wisely in your game.",
"Coins_50",//**NOT GOOGLE PLAY PRODUCT ID**
50,
ITEMID,
new PurchaseWithMarket(FIFTY_COINS,0.99f)
);
public static VirtualCurrencyPack MW_ITEM2 = new VirtualCurrencyPack("Buy 150 Coins",
"Use 150 coins wisely in your game.",
"Coins_150",//**NOT GOOGLE PLAY PRODUCT ID**
150,
ITEMID,
new PurchaseWithMarket(ONEFIFTY_COINS,1.99f)
);
public static VirtualCurrencyPack MW_ITEM3 = new VirtualCurrencyPack("Buy 300 Coins",
"Use 300 coins wisely in your game.",
"Coins_300",//**NOT GOOGLE PLAY PRODUCT ID**
300,
ITEMID,
new PurchaseWithMarket(THREEHUNDRED_COINS,2.99f)
);
}
Soomla has lots of IDS to assign. I am just confused which id to use where.
Here I am getting errors when I am calling buy item MW_ITEM1:
AndroidJavaException: com.soomla.store.exceptions.VirtualItem NotFoundException: Virtual item was not found when searching with productId=Coin s_50
I have deleted the app from device and reinstalled, then also not working, same error. I have deleted the app from device and updated app version and Soomla GetVersion() value build it and installed it using adb, then also it is giving me same error.
I am seeking help guys. Thanks
Upvotes: 0
Views: 1339
Reputation: 11
I had this problem too. In my case the problem was that the items were not active in Google Play.
Go to your in-app purchases settings in google play, select the inactive items, and change them to active.
Upvotes: 1