• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Android Hi! I need some help with IAPs please!

R

Rodrigo Renovatio

Guest
Hi! Im new in gaming development but I made this nice game called Booster Fox, its now on Play Store, the problem is when i want to add IAPs.

Im using the Google Play Services Extension, Google Play Services IAP Extension and Google Play Licensing As Extension. With the Billing permission com.android.vending.BILLING, Internet permission, Network state permission. Also im using the public key from Google Play Store Dev Console.

This is my code:

First object in creation Event:

var map_create = true;
if map_create
{
global.purchaseMap = ds_map_create();
var product2 = "credits100";
ds_map_add(global.purchaseMap, product2, 0);
ds_map_secure_save(global.purchaseMap, "iap_data.json");
}
var productList = ds_list_create();
pGold = ds_map_create();
ds_map_add(pGold, "id", "credits100");
ds_map_add(pGold, "title", "100 Credits");
ds_map_add(pGold, "type", "Consumable");
ds_list_add(productList, pGold);
iap_activate(productList);
ds_map_destroy(pGold);
ds_list_destroy(productList);

In a button obj in Left Pressed Event


if iap_status() == iap_status_available
{
var product = "credits100";
if ds_map_find_value(global.purchaseMap, product) == 0
{
iap_acquire(product, "");
}
}
else
{
show_message_async("Store is not available.");
}


Async Event:

var val = ds_map_find_value(iap_data, "type");
switch (val)
{
case iap_ev_purchase:
var map = ds_map_create();
var purchase_id = ds_map_find_value(iap_data, "index");
iap_purchase_details(purchase_id, map);
if ds_map_find_value(map, "status") == iap_purchased
{
var product_id = ds_map_find_value(map, "product");
ds_map_replace(global.purchaseMap, product_id, 1);
switch(product_id)
{

case "credits100":
iap_consume(product_id);
break;
}
}
ds_map_destroy(map);
break;
case iap_ev_consume:
var product_id = ds_map_find_value(iap_data, "product");
if ds_map_find_value(iap_data, "consumed")
{
ds_map_replace(global.purchaseMap, product_id, 0);
global.puntos += 100;
}
break;
}
ds_map_secure_save(global.purchaseMap, "iap_data.json");

The problem I saw is that its not even activating the IAP in my first object, always giving me this in the console:

Sound_Prepare()
InitGraphics()
Finished PrepareGame()
Run_Start
BILLING: Request deferred, store isn't available right now

I really dont know what to do, i tryed everything, i dont know if it is my code or my Google Play account (merchant account).
By the way, in my Google Play Account, in the Country field, it says Argentina, i dont have a banking account yet so I didnt fill the payments configuration, is it really necessary for iap tests?

Thanks a lot!

PD: sorry for my bad english hehe
 
Top