Best way to keep scores/preferences between free/non-free versions

Hi all,

I am developing a game and I want to release 2 versions: Free and paid. The free one has less functionality and ads, the paid one has full contents and no ads.

A lot of apps works that way, and if you play the free one, and make some achievements, you want to keep them when you purchase the full app. Now I use something like this:

file = io.open( path, “r” )

    if file then

         local score = file:read()

         local fails = file:read()

file:write( tostring(score) )

file:write( tostring(fails) )

There is a better way to save the game score? Can I save the score in a “secure” way (to avoid score hacking) and share that score between my two apps (free and paid versions)?

Hi @branyman,

Because of the way that apps are “sandboxed”, you can’t write/save a file locally in one app and then have the other app read that file. If you want to share details between two distinct versions, you may consider a cloud-based type of system, where you can store the info for a player and then retrieve it later or between each version.

Best regards,

Brent

If you’re using iOS ONLY you may be able to use the technique described in this article:

http://coronalabs.com/blog/2013/02/05/ios-tutorial-using-email-attachments/

It is not exactly a perfect, but your free app could produce an e-mail with an attachment that would then launch the paid version of your app and transfer the data you want moved over.

For security, you could roll your own basic data encode-decode functions (used by both free and paid version), or  use the crypto features in Corona and a common key on the free and paid versions.

Anyways, just a random idea.

Oh and don’t forget.  You could simply make one app that starts free and unlocks the rest of the features via In App Purchase.

Coronium.IO is a great cloud service, uses Lua for the server-side coding and has a game server element.

I did some research and I’m starting to use google play game services. It allows to register several games to the same leaderboards/achievements in the cloud, so I can save users records through free/paid and even ios/android/web versions of the same app.

Thank you for your answers!

With iOS GameCenter you can also connect several apps to one leaderboard. You have to create a Group in iTunes Connect.

Hi @branyman,

Because of the way that apps are “sandboxed”, you can’t write/save a file locally in one app and then have the other app read that file. If you want to share details between two distinct versions, you may consider a cloud-based type of system, where you can store the info for a player and then retrieve it later or between each version.

Best regards,

Brent

If you’re using iOS ONLY you may be able to use the technique described in this article:

http://coronalabs.com/blog/2013/02/05/ios-tutorial-using-email-attachments/

It is not exactly a perfect, but your free app could produce an e-mail with an attachment that would then launch the paid version of your app and transfer the data you want moved over.

For security, you could roll your own basic data encode-decode functions (used by both free and paid version), or  use the crypto features in Corona and a common key on the free and paid versions.

Anyways, just a random idea.

Oh and don’t forget.  You could simply make one app that starts free and unlocks the rest of the features via In App Purchase.

Coronium.IO is a great cloud service, uses Lua for the server-side coding and has a game server element.

I did some research and I’m starting to use google play game services. It allows to register several games to the same leaderboards/achievements in the cloud, so I can save users records through free/paid and even ios/android/web versions of the same app.

Thank you for your answers!

With iOS GameCenter you can also connect several apps to one leaderboard. You have to create a Group in iTunes Connect.