Google Play App free version data to pro version

So I recently finished doing some Google Play Service save data work, and I was wondering about a scenario like the following:

If I offer an app with a free version and a pro version as two different listing on the Play Store, and say an user was trying the game out on the free version, and data was saved. The user then purchases the pro version for ad-free or other reasons, how does one let the pro version use the data that was saved from the free version?

I am not asking for a Google Play Service save data approach necessarily, all methods of approach is welcomed.

I suppose when the user went to make the change (say, an in app purchase?) that the app then downloads all the data for the free version to a local file on the device that can be accessed from the paid version the first time it starts, and it then uploads that save data to the paid versions save on googles servers.

I can’t really think of a better way offhand and I haven’t used the play services saving, so can’t say for sure there isn’t an easier way…

And this way might not work if you just have users buy the version from the play store, because it won’t check if the free version had a save unless there is some sort of way it can check if the previous version was already installed (I think this is something android goodies on the asset store can do, check if another app is installed or not…)

To make it more flexible (so it won’t matter if they download from the play store or make an in app purchase to upgrade the installed version) it might be a better idea to do some universal local save system (a permanent save file that reflects locally whats in the google servers) and then each time the app is either installed from play, or paid for through an in app purchase, that the app checks against that local persistent file to make the initial save when it first starts.

How would I go about creating a file at runtime that saves this pro/free version flag, that cannot be removed via the standard uninstall? That is a method I will be happy to implement to do the pro/free check, and if they removed it manually, and then complain…well thats their fault. If by accident, I can just issue a promo manually.

Well the best way might be to save it to a common folder on android, like a place it won’t be uninstalled from (the local data folders I think do get erased). I guess this would mean having more permissions to do things like access the SD card or whatnot, to make a folder/file of data that is outside the unity apps “scope” of default permissions… I wish I knew more to help you further with that :X

I’m not sure how it might be done, really just all a suggestion as I’ve never tried something like that. But I suppose try to find a way to save a text file or something into a place that won’t get erased somehow…

An alternative might be to use a database or something where you save another temporary copy of the data to your own server, and do your first checks based on that instead of the google servers… and later update the google servers with the “live” data from the new version.

Doing it that way, you’d have the trouble of hosting a sql or firebase database or something, and it would complicate things significantly… so that might not be the best way…