Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Receipt validation - CrossPlatformValidator or AppleValidator?

Discussion in 'iOS and tvOS' started by BonusLevelDevelopment, Oct 6, 2016.

  1. BonusLevelDevelopment

    BonusLevelDevelopment

    Joined:
    Oct 20, 2013
    Posts:
    9
    I was able to test iAP's successfully, and I'm attempting to add receipt validation. The project I am working on is targeted for iOS only. (I have a separate project on my PC which will target Android) I'm following the process per https://docs.unity3d.com/Manual/UnityIAPValidatingReceipts.html , and parts of it were confusing to me.

    It states "You must supply this class with either your Google Play public key or Apple’s root certificate, or both if you wish to validate across both platforms.", and in my case, since my Unity project on my mac is not generating a GooglePlayTangle.cs file, I attempted to supply the class with only AppleTangle.Data(), which gave me the error:

    , which indicates I need to supply it with both GooglePlayTangle.Data() from the GooglePlayTangle.cs file which did not generate.

    So my question is: do I need to use CrossPlatformValidator? Or can I use the AppleValidator class instead? (The AppleValidator class was mentioned under the "Parsing raw Apple receipts" section in the above document)
     
  2. BonusLevelDevelopment

    BonusLevelDevelopment

    Joined:
    Oct 20, 2013
    Posts:
    9
    UPDATE: I was able to get the CrossPlatformValidator to work in-absence of GooglePlayTangle.cs. I passed "null" in-place of GooglePlayTangle.Data & the function performed properly. Note: it only worked ON AN IOS DEVICE, not the Unity Editor.
     
  3. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    389
  4. BonusLevelDevelopment

    BonusLevelDevelopment

    Joined:
    Oct 20, 2013
    Posts:
    9