Search Unity

check for IAP 'OS Restriction Settings

Discussion in 'Unity IAP' started by IgorAherne, Mar 8, 2019.

  1. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    339
    How can we determine if user has IAP restrictions set inside iOS or Android?

    I would like to show a warning message "please enable In-App-Purchases in your Device Restrictions Settings".

    I am using my class
    IAPManager : IStoreListener
    and things such
    as IStoreController::InitiatePurchase()


    Was looking for something like
    iOSRestrictions.IAP_isEnabled
    - does it exist?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,441
    I am not familiar with "Device Restriction Settings", is this something you've experienced in your testing?
     
  3. IgorAherne

    IgorAherne

    Joined:
    May 15, 2013
    Posts:
    339
    Thank you Jeff,

    For example, these settings in iPhone: https://support.apple.com/en-gb/HT204396
    They allow a parent to setup a 4-digit pin number and prevent the child from using IAP in any games on the phone. I would like to detect if this restriction is currently active
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,441
    Got it! I don't believe we have tested this feature, and we don't have a specific API to detect it. Have you been able to test? I suspect that IAP Initialization would succeed, but a Purchase would likely fail, perhaps with a specific failure reason that you could catch.