How can a server determine the amount of an iphone in-app purchase ?
The server receives the purchase's receipt sent by the app and uses this to validate it.
This returns some informations like a transaction_id, product_id, etc; but no amount or user details.
Since the amount depends on the currency and the user's country, how can I get the amount of the purchase on the server ?
But Apple will still charge a 30% fee for in-app purchases for top grossing apps, meaning the impact to Apple's financials could be minimal. In addition, the maximum discount for each publisher is capped, because the commission goes back to 30% after sales after Apple's fees cross $1 million.
The average purchase amount is $12.77 on iOS, $6.19 on Android and $8.80 overall. 7.1% of iOS users make at least one payment per month; 4.6% of Android users do. Asian users spend a monthly average of $0.70 per user per app; Latin Americans spend the least, at $0.16.
iPhone owners can now purchase extra content through free iPhone apps, whereas before in-app purchasing was only available in apps that cost money. Apple on Thursday sent e-mails to developers stating in-app purchases are now permitted in free apps.
It should be noted that server validation isn't mandatory — in-app purchases will still work without it. It grants some advantages, though: Advanced payment analytics, which is especially important for subscriptions since everything that happens after the activation isn't processed by the device.
From the same document, you can get product details localized through the SKProduct class, check this
If you are asking about how do the server knows it, when you setup an in-app purchase on the server you choose the price as tier, each tier has the price in different currencies so when you send the in-app purchase product id in the request, it check its price you setup and reflects it in the corresponding currency.
For device locale, check this and for device language check this but to get it from the server itself, Apple doesn't provide an API for it.
Now it is possible to set a different price for each country so the mapping of in app purchase to a pricing tier can be cumbersome.
You can get the price as the user see it in the UI and the price locale from the client and then send that information to your server.
For renewals - You can see renewals by verifying the receipt data on the server side and use the price sent by the client in the first transaction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With