Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question App Purchased verification

Discussion in 'iOS and tvOS' started by Rachan, Jan 14, 2022.

  1. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    758
    Hi there!

    I really want to know how to verifying purchased app from App Store
    such as get some invoice ID of that app and set it in some URL, so if that app has already purchased it should return true or something like this?

    Thanks!!!
     
  2. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    512
  3. Rachan

    Rachan

    Joined:
    Dec 3, 2012
    Posts:
    758
  4. Neonlyte

    Neonlyte

    Joined:
    Oct 17, 2013
    Posts:
    512
    It is possible. Both App Store and Google Play have respective services to verify a downloaded app's license. You can theoretically implement this right in your app (pure client-side), but it is more prone to removal by hackers. Client-server model is better where you relay the license to your server, and your server calls their server to get the result back.

    Google Play:
    https://developer.android.com/google/play/licensing/overview
    https://developer.android.com/google/play/licensing/client-side-verification

    App Store:
    https://developer.apple.com/documen...chase/choosing_a_receipt_validation_technique
    Note that the in-app purchase receipt and the app receipt is the same thing. The in-app purchase records are embedded in the bigger app receipt. If you verify the receipt for IAP, you may already verified the app receipt itself.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Do you have the original receipt or transactionID for the users app purchase within the context of your game? I support Unity IAP and the app receipt is indeed included with the IAP receipt, but ideally you don't want your users to also purchase something in-game if they have already paid for your game. I asked engineering here too, so far we are still checking.