1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Android [SOLVED] Problem importing purchase price from Google Play

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Schekhovtsov, Dec 4, 2019.

  1. Schekhovtsov

    Schekhovtsov Member

    Joined:
    Feb 8, 2019
    Posts:
    42
    Hello. The following error periodically occurs:

    [​IMG]
    if GPBilling_IsStoreConnected()
    {
    var _m = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[2]);
    var _c = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[2]);
    var _val = string(_m / 1000000);

    p_price_val[0] = _val;
    p_price_sym[0] = _c;

    var _m2 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[3]);
    var _c2 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[3]);
    var _val2 = string(_m2 / 1000000);

    p_price_val[1] = _val2;
    p_price_sym[1] = _c2;

    var _m3 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[4]);
    var _c3 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[4]);
    var _val3 = string(_m3 / 1000000);

    p_price_val[2] = _val3;
    p_price_sym[2] = _c3;

    var _m4 = GPBilling_Sku_GetPriceAmountMicros(IAP_PurchaseID[5]);
    var _c4 = GPBilling_Sku_GetPriceCurrencyCode(IAP_PurchaseID[5]);
    var _val4 = string(_m4 / 1000000);

    p_price_val[3] = _val4;
    p_price_sym[3] = _c4;
    }

    Does anyone know the reason and how to avoid the error?
     
  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,699
    The DoDiv in the error message tells you something wrong is going into those division operators. Check out the values from those m variables in the debugger and look for abnormalities there.
     
  3. Schekhovtsov

    Schekhovtsov Member

    Joined:
    Feb 8, 2019
    Posts:
    42
    Solved: We found out that the error occurred in the absence of the Internet. They added the condition that if there is no Internet, do not download data (prices) from Google Play
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice