Receipt Validation not working and players logged out



  • Hello,

    I followed the instruction for enabling ‘receipt validation only’ but the validation system is not working as expected. It does not detect when a receipt is not valid. E.g it accepts payments from the unity editor when it should say receipt invalid. I have receipt validation already in place for android and it doesn’t allow coins to be added to my balance in the editor. I need the asset for iOS but when I tested it on android it allowed the purchase to go through.

    Another issue that I am having is that Simple IAP causes players to be consistently logged out after 10 minutes. This issue disappears after I delete the asset.

    Is there a solution for this?

    Thanks



  • Hello,

    It does not detect when a receipt is not valid. E.g it accepts payments from the unity editor

    Unity Editor purchases are always deemed valid, since there are no receipts in the editor. We made it that way specifically to allow for testing. You can only test receipt validation running on real devices, doing real (test) purchases.

    I have receipt validation already in place for android and it doesn’t allow coins to be added to my balance in the editor.

    As said above, editor purchases do not have any receipts that could be validated, since there is no payment.

    I need the asset for iOS but when I tested it on android it allowed the purchase to go through.

    I do not understand exactly what's the issue. Could you elaborate after testing on a real device?

    Another issue that I am having is that Simple IAP causes players to be consistently logged out after 10 minutes.

    How are you testing this? Any steps to reproduce it? Do you let the editor running for 10 minutes, or do you mean that is happening on the device?



  • @Baroni thank you for clearing up the issue regarding unity asset purchases.

    How do I test if it actually works?

    In relation to the game resetting after 10 minutes. It is occurring in editor mode. I have a custom playfab login System which works perfectly but when I attach the simple IAP to the project and play the game it consistently resets to the login screen after 10 minutes. I am testing on an iOS build. In order to reproduce the issue change your platform to iOS and create a system using code which logs into playfab via nickname and password ( not your asset) then add Simple IAP for receipt validation only. Press play and Leave the game running.



  • How do I test if it actually works?

    Google Play provides the option to test declined purchases in their purchase UI. If the purchase is successfully verified, it shows up in the player's inventory on PlayFab.

    alt text

    alt text

    I'll try to reproduce the logout issue over the weekend, however I'm not exactly sure how to do that, since you're using your own login. Simple IAP System tries to login the user at the time of purchase, if not done already. I am not aware of any http session timeout by PlayFab, but let's see.



  • @Baroni Okay Thank you. I’m going to switch the platform to Android and see if the issue still occurs or if it is specific to iOS. If it’s ok I’ll let you know.



  • @Baroni I forgot to mention another issue that occurs. My game normally has promo interface available for 3 items but when I add Simple IAP to the scene and press play it say that the promo interface is available for 9 items. However, this returns to 3 if asset is deleted. Are there any solutions for this?



  • This is a message coming from Unity IAP, not our asset. We pass over the products you've defined in the IAP Settings editor. We have no control over promo functionality from Unity IAP.



  • @Baroni Ok thank you. I just tested the asset on Android .. the resetting issue does not occur. So it is specific to iOS.



  • I just tried to build my app to test if the restarting issue occurs on my device but received the following errors caused by Simple IAP:

    1. Error building Player because scripts had compiler errors

    2. Build completed with a result of 'Failed'
      UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

    3. UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
      at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:194
      at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:97
      UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

    How do I resolve this issue?
    Many thanks



  • I don't see any Simple IAP System classes. What makes you think they are coming from our asset? This are built in Unity UI classes.



  • Because when i delete the asset it builds. The same error occurs on both android and ios I am using unity 2018.4.22f1





  • Unfortunately none of the methods mentioned in the links worked. I’m going to delete the asset, reinstall It and then email you a screen recording of what happens



  • In your screen recording, with Unity IAP the first build fails at the step "Checking NDK". I still insist, the errors are not coming from our asset.

    Some more things I've found after googling the error:

    • download Unity IAP from the Asset Store, rather than the services panel (in one thread this solved corrupted files)
    • either way, make sure you are using the latest Unity IAP version (1.23.1) and that its packages (UnityIAP.unitypackage, optionally UDP.unitypackage) are imported correctly
    • In the Editor, open Edit -> Project Settings -> Player. In the Other Settings section, set or change: Scripting Runtime Version to ".NET 4.x". Set or change Api compatibility level first to ".NET 4.x". Try building again, if it still fails, try "Net 2.0" too - not 2.0 Subset!


  • Hi,

    I tried to build on iOS and received the same error message. iOS does not use NDKs so I don’t believe the issue is related to that.

    I notice that the build error disappears if if I delete the PLAYFAB_VALIDATION scripting define symbols so this issue is related to this.

    My project uses playfab cloud scripting and has a playfab wrapper in the scene is it possible that your script is clashing with mine?

    Please check your email inbox.


Log in to reply