Search Unity

Question APP rejected for iap

Discussion in 'iOS and tvOS' started by Alexbuy, Nov 21, 2022.

  1. Alexbuy

    Alexbuy

    Joined:
    May 22, 2019
    Posts:
    4
    Next Steps


    When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.


    Resources


    - Learn how to set up and test in-app purchase products in the sandbox environment.

    - For more information on receipt validation, see the In-App Purchase FAQ.

    - If your app makes a SKReceiptRefreshRequest call and fails, do not retry the call. Assume the user does not have access. Continue by making the addPayment call.

    - If your app makes a SKReceiptRefreshRequest call to restore previously purchased in-app purchases, make sure the app calls restoreCompletedTransactions when the user selects the "Restore" button.

    Please see attached screenshot for details. Request a phone call from App Review


    At your request, we can arrange for an Apple Representative to call you within the next three to five business days to discuss your App Review issue.





    ______________



    Hi guys, I am facing this problem with iap, in the editor everything works great but on testflight not at all.
    p.s. everything in the editor and on apple developer is set corectly.
    here are the codes:


    _________________________ 1

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class Shop : DialogBase
    7. {
    8.     [SerializeField] private DiamondPack[] DiamondPacks;
    9.     [SerializeField] private CoinPack[]    CoinPacks;
    10.     [SerializeField] private RemoveAdsPack remove_ads_pack;
    11.  
    12.     public override void Init ()
    13.     {
    14.         base.Init ();
    15.        
    16.         InitShopDiamond ();
    17.         InitCoinPack ();
    18.         InitRemoveAds ();
    19.     }
    20.  
    21.     private void InitRemoveAds ()
    22.     {
    23.         remove_ads_pack.Init ();
    24.         remove_ads_pack.RefreshPrice ();
    25.     }
    26.    
    27.     private void InitShopDiamond ()
    28.     {
    29.         for (int i = 0; i < DiamondPacks.Length; i++)
    30.         {
    31.             DiamondPacks[i].Init ();
    32.             DiamondPacks[i].RefreshPrice ();
    33.         }
    34.     }
    35.  
    36.     private void InitCoinPack ()
    37.     {
    38.         for (int i = 0; i < CoinPacks.Length; i++)
    39.         {
    40.             CoinPacks[i].Init ();
    41.             CoinPacks[i].RefreshEarn ();
    42.         }
    43.     }
    44.  
    45.     public override void Enable ()
    46.     {
    47.        base.Enable ();
    48.    
    49.         for (int i = 0; i < DiamondPacks.Length; i++)
    50.         {
    51.             DiamondPacks[i].RefreshPrice ();
    52.         }
    53.  
    54.         for (int i = 0; i < CoinPacks.Length; i++)
    55.         {
    56.             CoinPacks[i].RefreshEarn ();
    57.         }
    58.        
    59.         remove_ads_pack.RefreshPrice ();
    60.     }
    61.    
    62.     #region Interact
    63.  
    64.     public void InteractClose ()
    65.     {
    66.         DialogExtension.DisableDialog (DialogEnum.DialogId.Shop);
    67.        
    68.         SoundManagerExtension.PlayAudioSound (AudioEnums.SoundId.Fx_Touch_Button);
    69.     }
    70.    
    71.     #endregion
    72.  
    73. }

    _____________________ 2



    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;

    public class DiamondPack : MonoBehaviour
    {
    [SerializeField] private Text label_name;
    [SerializeField] private Text label_price;
    [SerializeField] private Text description_sale;
    [SerializeField] private Transform transform_sale_cover;

    [Header ("Button")] [SerializeField] private Button button_buy;

    [Header ("Data")] [SerializeField] private IapData IapData;

    public void Init ()
    {
    label_name.text = IapData.GetDescription ();

    if (string.IsNullOrEmpty (IapData.GetDescriptionSale ()))
    {
    transform_sale_cover.gameObject.SetActive (false);
    }
    else
    {
    transform_sale_cover.gameObject.SetActive (true);
    }

    description_sale.text = IapData.GetDescriptionSale ();
    }

    public void RefreshPrice ()
    {
    switch (IapData.GetIapId ())
    {
    case IapEnum.IapId.Free:
    label_price.text = "WATCH";
    break;
    default:
    label_price.text = IapManager.Instance.ReturnThePrice (IapData.GetIapKeyId ());
    break;
    }
    }

    private void OnBuyDiamondCompleted ()
    {
    // =============================== Init fx ================================ //
    if (!ReferenceEquals (GameManager.Instance, null))
    {
    GameManager.Instance.InitFxDiamond (IapData.GetValue (),
    transform.position,
    UIGame.Instance.GetDiamondIconPosition ());
    }
    else
    {
    ActionExtension.PostActionEvent (ActionEnums.ActionID.RefreshDiamond);
    }
    }

    private void OnWatchAdsCompleted ()
    {
    UserData.Instance.Diamond += IapData.GetValue ();

    SaveGame.Save ();

    OnBuyDiamondCompleted ();
    }

    public void InteractBuy ()
    {
    switch (IapData.GetIapId ())
    {
    case IapEnum.IapId.Free:
    AppManager.Instance.MinusCurrency (Currency.CurrencyId.Ads, 0, OnWatchAdsCompleted);

    break;
    default:
    IapManager.Instance.BuyProductWithID (IapData.GetIapKeyId (), OnBuyDiamondCompleted);
    break;
    }

    SoundManagerExtension.PlayAudioSound (AudioEnums.SoundId.Fx_Touch_Button);
     
  2. Alexbuy

    Alexbuy

    Joined:
    May 22, 2019
    Posts:
    4
    hello :D
     
  3. BBO_Lagoon

    BBO_Lagoon

    Joined:
    Mar 2, 2017
    Posts:
    200
    Hi,
    It seems you are not using Unity IAP, what do you use for managing IAP in your game ?
    Do you have a server side validation for your IAP ?