Search Unity

Logged out of iTunes account, deleted app, purchase still being restored.

Discussion in 'Unity IAP' started by gtzpower, Mar 10, 2018.

  1. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    Hey everyone, I am using codeless IAP and my app was rejected by Apple for not having a restore feature for my non-consumable product. So I decided to recreate the state that would require a restore button first; log out of iTunes, delete the app, and then launch the app unauthenticated. The only problem is, I can NOT get the app into a state where the purchase should be restored. Unity is fulfilling the non-consumable purchase even though I am not signed into iTunes. This happens a second or so after the IAP button is enabled.

    Any idea what I need to do to get the IAP into a restorable state? I really don't want to wipe my tablet, but I am not sure how Unity is processing this purchase unless something in iOS is telling Unity that the last user owns the non-consumable already.

    IAP 1.17.0
    Unity 2017.3.1
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Is this occurring in TestFlight for you? To reproduce, can you confirm the following steps

    1) In TestFlight, run the app and make a non-consumable purchase
    2) Uninstall and reinstall the app
    3) Upon first launch, click the Restore button, and check to make sure ProcessPurchase is correctly being called.

    Also, when you say "Logged out of iTunes", are you logged onto the iOS device as a user?
     
  3. gtzpower

    gtzpower

    Joined:
    Jan 23, 2011
    Posts:
    318
    Thanks for the response. I was testing on a manually deployed build. Today I had an opportunity to follow up so I did another manual deployment which I was going to upload to TestFlight to follow your steps, but the problem doesn't seem to be happening today. I am having some new problems, but they probably belong in another thread.

    FWIW, by "Logged out of iTunes" I was referring to going into Settings -> iTunes & App Stores -> Tapping my username and choosing "Log Out". Today, for whatever reason, it seems to be preventing the instant restore on both of my test devices.
     
  4. Nidhii

    Nidhii

    Joined:
    Jan 28, 2015
    Posts:
    26
    @gtzpower @JeffDUnity3D Was this problem resolved? I am facing same issue. When I click Restore, it asks me to login. If I click cancle it restores the app anyway..
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @IES Is this on TestFlight? And can you clarify, "restores the app". I suspect you meant restores the in-app-purchases, please confirm. How are you determining that ProcessPurchase is being called? Unity IAP is a pass-through service for the stores, we don't specifically handle any login security, that is done by the stores.
     
  6. Nidhii

    Nidhii

    Joined:
    Jan 28, 2015
    Posts:
    26
    @JeffDUnity3D Yes I am testing it on testflight and yes I meant restores the In app purchase even if I click cancel. Although the strange part is I cannot reproduce it anymore. But both me and my client saw this earlier multiple times..
    I will post a video if I see it again.
    I am only calling InitializePurchasing in start function.
    void Start() {
    if (m_StoreController == null)
    { InitializePurchasing(); }
    }

    public void InitializePurchasing()
    {
    if (IsInitialized())
    { return; }
    var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
    builder.AddProduct(kProductIDNonConsumable, ProductType.NonConsumable);
    UnityPurchasing.Initialize(this, builder);
    }
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you are seeing different behavior with no code changes, then this could be due to changes on the Apple end.
     
    Nidhii likes this.