As much as you can, always delegate sensitive data and logic to your backend. It will be a lot harder for your users to abuse from your system and in case of bugs or security issues, it will be a lot easier for you to fix them.
Here are some examples of bad practices:
Purchasely does all the heavy lifting with no coding needed so your whole team can enjoy increasing app subscription revenues, effortlessly.
To prevent malicious users from accessing and/or redistributing your unlocked content, do not bundle it in your app. Instead, retrieve it from your server or any other real-time service.
Then you'll be able to store in on the user's device... but be sure to encrypt the content and use a device-specific encryption key!
After a user has made a purchase in your app, you should do the following:
receipt data
(Apple App Store) / purchase token
(Google Play Store, Huawei AppGallery) / receipt id
(Amazon Appstore) to you server;linkedPurchaseToken
for the Google Play Store;oriSubscriptionId
for the Huawei AppGallery;
Voided purchases are purchases that have been canceled, revoked, or charged back.
The best way to detect them quickly is to subscribe to the "server-to-server notifications" services offered by the different stores. They will send Webhooks to your servers on real time when the status of a purchase is changed.
Documentations:
Revoke entitlements in case of subscription, perform clawbacks for one-time-purchases. For example, if you sell virtual coins in your app, and the reimbursed users have already used them, apply a negative balance to their account.
Stay moderate with newly-reimbursed users. If they reiterate, apply more drastic measures (like disabling purchases or forbid access to your app for the user until your investigation is finished).
💡 If you're interested on how to detect void purchases, you can check our article on How to detect an expired subscription.
Step-by-step for marketers to effortlessly launch multi-channel, responsive in-app subscriber attrition and retention campaigns.
Some types of fraud are related to malicious users who create multiple Apple/Google and in-app accounts to hide their activity. You can give more anonymised information on your users to help detect this kind of behaviour:
applicationUsername
;setObfuscatedAccountId
and setObfuscatedProfileId
methods in the builder for BillingFlowParams
;
Nothing is easier than Purchasely to avoid fraud: our solution will do all the work for you!
4 lines of code in your app to integrate Purchasely and you're ready to go, free from malicious users :)