Search Unity

Resolved Codeless IAP Restore after purchase

Discussion in 'Unity IAP' started by 77Chris77, Aug 22, 2019.

Thread Status:
Not open for further replies.
  1. 77Chris77

    77Chris77

    Joined:
    Oct 24, 2015
    Posts:
    23
    Hello,

    Just wanted a bit of advice on iOS codeless IAP restore.

    I have 2 IAP buttons in my purchase scene to make Admob ads disappear.

    1. Buy button
    2. Restore button
    When I buy for the first time the purchase is completed and the ads disappear. Which works ok.

    When I reinstall the app and press the ‘buy’ button the iOS App Store recognises that I have already purchased and states that the purchase will be restored free of charge. Then I have to press the restore button and the ads disappear, which is fine but is that how it should work? Should it not restore automatically?

    Thanks
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Restore is not automatic on iOS, but it is on Android.
     
  3. 77Chris77

    77Chris77

    Joined:
    Oct 24, 2015
    Posts:
    23
    Oh great then I guess it’s working correctly.

    Thank you
     
  4. 77Chris77

    77Chris77

    Joined:
    Oct 24, 2015
    Posts:
    23
    Hello, me again.

    I have completed the iOS version.

    For Android:
    I can test the app through a testing track through the google play console. When the game is installed for the first time I can purchase the IAP and all works fine. But if I uninstall the app and download it again the Admob adds show and if I click the buy Botton the game slightly pauses for a second but nothing happens. But if I signed out of my google account on my phone and sign back in, then press the buy button, the prompt shows asking me to purchase the IAP again. Should it not detect that I have already purchased this item?

    thanks
     
    Last edited: Aug 24, 2019
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It depends on how you've configured your product. Please share screenshots of how you are adding your product, and also the device logs. https://forum.unity.com/threads/how-to-capturing-device-logs-on-android.528680/
     
  6. 77Chris77

    77Chris77

    Joined:
    Oct 24, 2015
    Posts:
    23
    Hello,

    Sorry for the late reply. It was due to incorrect placement of the listeners. All work fine now.

    Thanks
     
  7. itierney

    itierney

    Joined:
    Jan 28, 2019
    Posts:
    27
    @JeffDUnity3D

    When you add an IAP Restore button, the preferences to set a function disappear.
    Also when I look at the IAP rockets example the restore button isn't even a IAP button!

    So just to clarify:
    1. When I use an IAP_restore button do I have to write additional code to trigger a restore? (Many tutorial say you don;t)
    2. If so where do I put this code and how to I link it to the IAP button (all options disappear when you set the button type to restore!)
    3. At the moment I am just creating an IAP button and setting it to restore (no additional code). When I look at the console while running on an iPhone it prints the following but nothing happens...so iOS sign in..nothing!

    2022-11-05 19:31:46.901607+0000 PocketBuddha[67035:5564595] UnityIAP: RestorePurchase

    2022-11-05 19:31:47.922061+0000 PocketBuddha[67035:5564595] UnityIAP: PaymentQueueRestoreCompletedTransactionsFinished"
     
  8. Yannick_D

    Yannick_D

    Unity Technologies

    Joined:
    Feb 21, 2022
    Posts:
    235
    Closed since the initial problem was resolved.

    The new issue was answered in another thread
     
Thread Status:
Not open for further replies.