Announcement

Collapse
No announcement yet.

iOS InAppPurchase

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    iOS InAppPurchase

    Hello

    I've been working on my first game in Unreal Engine for the past 2 months, I have no experience in coding so I'm working in Blueprints.

    I have reached many obstacles but was always able to find a solution on the forums, on YouTube or within the documentation.

    Unfortunately I feel like I got to a point where I'm stuck, so I'm reaching out for help if possible.

    I have a store in my game where the player can buy In App Purchases to acquire Coins and Orbs in game. The workflow seemed very easy and straightforward.

    I have a Read In App Purchase information node when the player opens the store. This sets the price for each item if successful.

    Click image for larger version

Name:	Annotation 2020-05-20 043615.png
Views:	58
Size:	174.5 KB
ID:	1763990
    Then I have a Make an In App Purchase when the player clicks the buy button, which if successful, adds the amount of coins to his total coins. And if failed, I just play a Transaction Failed animation.
    Click image for larger version

Name:	Annotation 2020-05-20 043648.png
Views:	28
Size:	68.6 KB
ID:	1763991
    I added all my IDs correctly and set everything up in the Google Play Store and the App Store.

    I tested the game on my Android device and the In App Purchase worked fine.

    But when I tested my game on TestFlight, the Read In App Purchase was failing as well as the Make an In App Purchase.
    I tried submitting the App for review and got my app rejected because of those errors with the following instructions:

    "Next Steps:

    When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead."

    Now this got me extremely confused as the provided apple documentation mentions receipts with links that I have no idea where to input.
    I saw a lot of people saying that i should disable StoreV2, and I did, hoping it would solve it, but I got the same error and reply from Apple's review.

    Then after more online digging, some users were mentioning that these transactions were not safe and were easily hacked, so using a plugin like PlayFab would make it safer. Also PlayFab has a Validate iOS Receipt node which got me thinking that I'm on the right track.

    Unfortunately, PlayFab has so little documentation on how to use it with Blueprints and I have literally no idea how to proceed with it.

    Can anyone point me on the right track or provide any help if possible?

    Thank you

    #2
    So it turned out disabling StoreV2 in your project folder does not work. I found out that another iOSEngine.ini file exists inside the installation directory and fixing this one got my app working and approved at last.

    I really wish Apple didn't provide this confusing feedback:
    "When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead."

    It turned out it's just a template reply that seemed irrelevant to my problem.

    On the other hand, adding Receipt validation with PlayFab seems like an extra layer of security that I don't know if still necessary, but as I couldn't find any documentations I just let it go for now.

    Comment

    Working...
    X