- Home /
premium feature inside game
i want to add a premium feature inside the game once the user buy it from google play i will save it on PlayerPrefs .
the problem is: how would i know if the user download the game again or reset his data that he is a premium ?
i am not using a 3rd party service, i am using a local database.
so should i use an online database for this field only?
Answer by Razor1994 · May 31, 2020 at 07:17 PM
What you need is an external database and an extern (web)-server to check authentication and their premium status. Your client could than check the server via a webrequest and get its status. But keep in mind that the player can edit everything on his local client so the client should be depending on something that it gets from the server (e.g. a token or his saved data).
When the client tries to access premium features it has to check against the web-server to check if the player is able to use the premium feature. The premium feature should only work when the server gives the OK.
is there a way to do that using google play without using external database?
I am sorry but i have never worked with google play services other than push notifications so i am not sure if google offers such a service.
Answer by Mrintoxx · May 31, 2020 at 02:58 PM
I don't know if i'm helping but playerprefs are not secure, the player can modify the playerprefs as he wants. Check that link who unity team talks about security He explains a part of you problem, might help you.
thanks for your answer.
i know playerprefs will not help, but what do you suggest about checking if the user bought premium before?
I'm not a pro in that but they talk about it in the link i've send you, assign an ID to each player who played the game and then check if the player ID have bought premium. Something like @Razor1994 have suggested
Your answer
Follow this Question
Related Questions
Is it possible to set a developer payload in unity in-app purchasing? 1 Answer
Unity IAP Initalisation Fails due to No Product Avalible (Google) 0 Answers
OnPurchaseFailed is called but users get charged 0 Answers
Unity IAP doesn't always consume 1 Answer
Google Play Games Services crashes my game at startup every time. 0 Answers