Search Unity

[Solved] In-app purchase script example for iOS

Discussion in 'Unity IAP' started by LastChaos, Oct 24, 2016.

Thread Status:
Not open for further replies.
  1. LastChaos

    LastChaos

    Joined:
    Dec 9, 2013
    Posts:
    39
    Hi. Can someone show an example script with IAP in-game purchases for iOS? I don't understand how it works in the case of the iOS. For Android it was a lot easier to master it.

    Thanks.
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    Hi @LastChaos,

    You don't actually need different scripts for iOS and Android. Unity IAP is a cross-platform solution. There are some small differences, such as how the platforms handle Restoring purchases after a user uninstalls and re-installs your app. You can see those details here:
    https://docs.unity3d.com/Manual/UnityIAPiOSMAS.html

    We have published a guide that integrates IAP into a sample project:
    https://unity3d.com/learn/tutorials/topics/analytics/integrating-unity-iap-your-game

    The main difference is how the IAP products are created in the stores. We have an iOS-specific guide for that: https://docs.unity3d.com/Manual/UnityIAPAppleConfiguration.html

    We also have our Manual that has more details about all the features and supported platforms of Unity IAP:
    https://docs.unity3d.com/Manual/UnityIAP.html
     
  3. LastChaos

    LastChaos

    Joined:
    Dec 9, 2013
    Posts:
    39
    Thanks for answer.

    I have done everything as it says in the guide. But I have problem on step "Using the target iOS device, sign out of any existing Apple ID accounts and sign in as the Sandbox Tester":
    fullsizeoutput_3.jpeg
    And probably because of that, I get the error: NoProductsAvailable. What am I doing wrong?
     
    Last edited: Oct 25, 2016
  4. clock131

    clock131

    Joined:
    Jun 21, 2014
    Posts:
    4
    I have the same problem. Any idea?
     
  5. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @LastChaos,

    For that step, try signing out of your normal iTunes account and then don't sign in to any other account. Start your game and try to purchase something. Now when you get a popup asking you to sign in, this is where you should enter your sandbox id and password.
     
    hahahpizza likes this.
Thread Status:
Not open for further replies.