Could anybody help me to understand the following schema? I have an iOS app and an app server. A connection between app and server (1A, 1B) is already working.
Let's say a user of the app has 10 gems, which controlled by the server due to security reasons. I have a consumable IAP type in the AppStore: 100 gems pack and the user wants to buy it. Of course, I want to make a record in my Mongo database to increase the number of gems for the user.
How does this flow work? Should I use StoreKit in the app first and then communicate to the server? Or can make an endpoint on the server like "/buyPack/100gems" and do everything on the server side? As far as I understand I need to validate a receipt from the AppStore, but where to get it and what does it contain?
If you could use my arrows (1A, 2A, 3B and so on) I will really appreciate this.