Search Unity

[Solved] IAP progress save after cache clear

Discussion in 'Unity IAP' started by VKBobyr, Mar 10, 2017.

Thread Status:
Not open for further replies.
  1. VKBobyr

    VKBobyr

    Joined:
    Mar 3, 2017
    Posts:
    1
    Hello!

    I was working on my first commercial app, which generates the revenue using Unity Ads, but there's also an option to buy a non-consumable IAP for $0.99, which will disable ads for good. Currently I'm using a CodeStage anti-cheat plugin to encrypt the PlayerPrefs, and store the purchase data locally (I know it's still possible to hack it with a bit of effort, but this encryption is good enough for me). The only issue I'm having is that if I clear app cache on Android, it removes all the locally stored data, erasing all the information about the purchase, etc. This is a problem, because if the player were to start the app again later, they would notice that their purchase is gone, along with the high scores. I could care less about the high score, because they get a warning about them, but I'm worried about the legal issues that the returning ads and the "Free version" pop-up would cause after the cache reset.

    Below is an example of what my "Purchase" method does. (I'm using codeless IAP). ObscuredPrefs is the plugin's secure version of PlayerPrefs.

    // Removes the ad button and changes the version
    public void BuyGame(){
    ObscuredPrefs.SetString(versionKey, paidVersion);
    btnRemoveAds.SetActive(false);
    }​

    Is there a way of asking the Play Store and App Store whether the IAP has been purchased recently, or storing the information on some kind of external database? If so - how?

    Thanks in advance,
    Vlad
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
Thread Status:
Not open for further replies.