Hey all,
I’m integrating the Soomla store to my Unity game but it wouldn’t work.
My problem is : when i run it on my android device and i press the butons for pay with google play, nothing is happening, there is no errors and no message. And when I debug it whit unity, there is no error message. If needed I can provide some logs.
I explain my steps below :
First I drag the CoreEvents and the StoreEvents on my splash screen scene. Then I made three files, the IStoreAssets, another for the initialisation and a script who call functions for buy items.
Next, I setup Soomla settings in Unity, google integrated products and plublished my app in closed alpha.
Implementation of the IStoreAssets :
public int GetVersion() {
return 0;
}
public VirtualCurrency[] GetCurrencies() {
return new VirtualCurrency[]{};
}
public VirtualGood[] GetGoods() {
return new VirtualGood[] {UFO_SKIN_LTVG, SUPERHERO_SKIN_LTVG, SPACESHIP_SKIN_LTVG, NO_ADS_LTVG};
}
public VirtualCurrencyPack[] GetCurrencyPacks() {
return new VirtualCurrencyPack[] {};
}
public VirtualCategory[] GetCategories() {
return new VirtualCategory[]{};
}
/** Static Final Members **/
public static VirtualGood UFO_SKIN_LTVG = new LifetimeVG(
"Ufo skin", // name
"Ufo skin desc", // description
"ufo_skin", // item id
new PurchaseWithMarket(new MarketItem("ufo_skin", 1.00)));
public static VirtualGood SUPERHERO_SKIN_LTVG = new LifetimeVG(
"Super Hero skin",
"Super Hero skin desc",
"superhero_skin",
new PurchaseWithMarket(new MarketItem("superhero_skin", 1.00)));
public static VirtualGood SPACESHIP_SKIN_LTVG = new LifetimeVG(
"Spaceship skin",
"Spaceship skin desc",
"spaceship_skin",
new PurchaseWithMarket(new MarketItem("spaceship_skin", 1.00)));
public static VirtualGood NO_ADS_LTVG = new LifetimeVG(
"No Ads",
"No More Ads!",
"no_ads",
new PurchaseWithMarket(new MarketItem("no_ads", 1.00)));
The initialisation ( I made it on splashscreen launching) :
void Start () {
SoomlaStore.Initialize (new StoreAssets());
}
The function script (I use it on 4 differents butons on another scene) :
public void RemoveAddsPressed () {
StoreInventory.BuyItem ("no_ads");
}
public void BuyUfoSkinPressed () {
StoreInventory.BuyItem ("ufo_skin");
}
public void BuySuperHeroSkinPressed () {
StoreInventory.BuyItem ("superhero_skin");
}
public void BuySpaceShipSkinPressed () {
StoreInventory.BuyItem ("spaceship_skin");
}
I’ve tested with the soomla higway to. Like this :
void Start () {
SoomlaHighway.Initialize();
SoomlaStore.Initialize (new StoreAssets());
}
But this code make the game crash on splashscreen.
Can someone help me to see if I made a mistake on the code or in another part of the integration ?
Here is a link to my first post on the soomla aswer page : http://answers.soom.la/t/fail-to-operate-soomla-and-do-not-understand-the-error/3208?u=d_lopes
Thank’s