Skip to main content
Inspiring
January 3, 2012
Question

What's the safe way to save state on iPhone that Apple will not decline?

  • January 3, 2012
  • 7 replies
  • 1471 views

Hi, I read somewhere recently (can't find the thread again) that someone's app got declined by Apple cause the way he saved his game info to the device was not... ok with them.

I've found maybe three ways to save to the device on the internet, two of them mentioned in this thread: http://www.adobe.com/devnet/flash/articles/saving_state_air_apps.html

Could someone please sum up the different ways to save? One save saves to some default folder, another one saves to a folder AND location you choose, then there's saving by using shared objects and other methods (I think).

Which one should I use for iPhone?

This topic has been closed for replies.

7 replies

Inspiring
January 31, 2012

"Temporary files used by your app should only be stored in the /tmp directory; please remember to delete the files stored in this location when the user exits the app."

How do you detect when the user exits the app? I have files that are being used in the /tmp directory that need to stay there for the app session and/or until the user is done editing a file.

Participating Frequently
January 24, 2012

I save state with SharedObjects and haven't had any problems with app store rejections. So far I have been able to publish 3 apps, the most recent of which was accepted 2 weeks ago.

Known Participant
January 25, 2012

Thank you for the reply Timothy. That is really interesting to know that you have not been rejected saving state with shared objects. Do you happen to know if a user installs another instance of the app on another device, will this other device pick up the state? i.e is this state shared object somehow downloaded via the cloud and made available to all devices running the app for this particular user?

TenchyMyoAuthor
Inspiring
January 25, 2012

My app wasn't rejected either using the method I mentioned in the second post.

TenchyMyoAuthor
Inspiring
January 3, 2012

I've tried the shared object method and it works great and is easy to understand, so I would like to be able to use this method, but the question remains: will this method of saving be rejected on app store?

shared object like this:

function save():void {

    // Get the shared object.

    var so:SharedObject=SharedObject.getLocal("myApp");

    // Update the age variable.

    so.data["age"] = int(so.data["age"]) + 1;

    so.data["moo"]="hej"

    // And flush our changes.

    so.flush();

}

Known Participant
January 24, 2012

As far as I can gather from the limited information available, saving data using shared objects would be rejected by Apple unless the data it was saving was essential for your app to function properly.

See this thread