• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by mohamedelzallat3 · May 31, 2020 at 12:06 PM · google playinapp purchase

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?

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image

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.

Comment
mohamedelzallat3

People who like this

1 Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mohamedelzallat3 · May 31, 2020 at 07:18 PM 0
Share

is there a way to do that using google play without using external database?

avatar image Razor1994 mohamedelzallat3 · May 31, 2020 at 07:20 PM 0
Share

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.

avatar image mohamedelzallat3 Razor1994 · May 31, 2020 at 08:07 PM 0
Share

no problem, thanks.

avatar image

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.

Comment

People who like this

0 Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mohamedelzallat3 · May 31, 2020 at 06:48 PM 0
Share

thanks for your answer.

i know playerprefs will not help, but what do you suggest about checking if the user bought premium before?

avatar image Mrintoxx mohamedelzallat3 · May 31, 2020 at 08:02 PM 0
Share

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

avatar image mohamedelzallat3 Mrintoxx · May 31, 2020 at 08:07 PM 0
Share

no problem, thanks.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

132 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity IAP doesn't always consume 1 Answer

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

Google Play Console Problem : Google Play Developer API v3 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges