iap_acquire doing nothing

JFitch

Member
I have an array named "purchases" which stores a 0 or 1 for purchases[0] through purchases [3], based on whether a product has been purchased.

I call the iap_acquire function when the mouse is pressed, but nothing happens.

I'm new to In App Purchases, so I'm sure I'm doing something wrong, but I don't know what.

Create Event:
Code:
purchases[0]=0;
purchases[1]=0;
purchases[2]=0;
purchases[3]=0;

if os_type=os_android
{
var purchaseList, purchase1, purchase2, purchase3, purchase4;
purchaseList = ds_list_create();
purchase1 = ds_map_create();
purchase2 = ds_map_create();
purchase3 = ds_map_create();
purchase4 = ds_map_create();

ds_map_add(purchase1, "id", "proportional");
ds_map_add(purchase1, "title", "Proportional Stretch Out");
ds_map_add(purchase1, "description", "unlocks the Proportional Stretch Out method of multiplying two numbers");
ds_map_add(purchase1, "price", "$0.99");

ds_map_add(purchase2, "id", "threeway");
ds_map_add(purchase2, "title", "Three Way Multiplication");
ds_map_add(purchase2, "description", "unlocks methods for multiplying three numbers");
ds_map_add(purchase2, "price", "$1.99");

ds_map_add(purchase3, "id", "divisibility");
ds_map_add(purchase3, "title", "Divisibility and Checking Work");
ds_map_add(purchase3, "description", "unlocks methods for testing divisibility and checking work using divisibility");
ds_map_add(purchase3, "price", "$3.99");

ds_map_add(purchase4, "id", "decimals");
ds_map_add(purchase4, "title", "Decimals");
ds_map_add(purchase4, "description", "unlocks calculating the decimal part when dividing");
ds_map_add(purchase4, "price", "$5.99");

ds_list_add(purchaseList, purchase1, purchase2, purchase3, purchase4);
iap_activate(purchaseList);
ds_map_destroy(purchase1);
ds_map_destroy(purchase2);
ds_map_destroy(purchase3);
ds_map_destroy(purchase4);
ds_list_destroy(purchaseList);

var p_map1 = ds_map_create();
var p_map2 = ds_map_create();
var p_map3 = ds_map_create();
var p_map4 = ds_map_create();
iap_purchase_details("proportional", p_map1);
iap_purchase_details("threeway", p_map2);
iap_purchase_details("divisibility", p_map3);
iap_purchase_details("decimals", p_map4);
if ds_map_find_value(p_map1, "status") == iap_purchased
   {
   purchases[0]=1;
   }
if ds_map_find_value(p_map2, "status") == iap_purchased
   {
   purchases[1]=1;
   }
if ds_map_find_value(p_map3, "status") == iap_purchased
   {
   purchases[2]=1;
   }
if ds_map_find_value(p_map4, "status") == iap_purchased
   {
   purchases[3]=1;
   }
ds_map_destroy(p_map1);
ds_map_destroy(p_map2);
ds_map_destroy(p_map3);
ds_map_destroy(p_map4);
}
Global Left Released Event:
Code:
if selected_step.textdrawn="Premium#Upgrades" && mouse_x>400
    {
    if mouse_y>170 && mouse_y<570 && os_type=os_android
        {
        var target=(mouse_y-170) div 100;
        if !purchases[target]
            {
            if target=0
                {
                iap_acquire("proportional", "")
                }
            if target=1
                {
                iap_acquire("threeway", "")
                }
            if target=2
                {
                iap_acquire("divisibility", "")
                }
            if target=3
                {
                iap_acquire("decimals", "")
                }
            }
        }
    if mouse_y>100 && mouse_y<140
        {
        url_open_ext("http://mathgeniusguide.com/privacy.html","_blank") // THIS LINE WORKS
        }
    }
IAP Event:
Code:
var p_map = ds_map_create();
var p_index = ds_map_find_value(iap_data, "index");
iap_purchase_details(p_index, p_map);
if ds_map_find_value(p_map, "status") == iap_purchased
    {
    if p_index="proportional"
        {
        purchases[0]=1;
        }
    if p_index="threeway"
        {
        purchases[1]=1;
        }
    if p_index="divisibility"
        {
        purchases[2]=1;
        }
    if p_index="decimals"
        {
        purchases[3]=1;
        }
    }
ds_map_destroy(p_map);
 

JFitch

Member
I don't think it's the code. I checked it using the adb logcat and I got this error.

06-20 19:25:24.785 16529 16545 I yoyo : BILLING: Request deferred, store isn't available right now
 
Top