I'm writing an offline capable web app where all data will be stored
locally in the iPhone's database. However I will need a mechanism to
support the import and export of user's data without sending the data
to my server. I'm thinking of the following method and don't know if
it will work.

Exporting:
I serialize all the data (megabytes of it) into a data URL and load up
that page and instruct the user to "Mail Link to this Page". The
iPhone's Mail app should launch and include the data URL in the email
body. Then they can send it to another iPhone or back it up.

Importing:
After the user receives the email on another iPhone, they click on the
data URL to load it up in Safari. Before this, I write a bookmarklet
and have the user add it beforehand to their Safari bookmarks. Then I
instruct the user to run the bookmarklet on the data URL page in
Safari. The bookmarklet will load up my app from my domain in an
iframe, and using some cross-domain communication techniques (e.g.,
Brad Neuberg's window.name IO, Dojo's fragment identifier messaging,
etc.) pass the data from the data URL site to the iframe and have my
app import it into the new database.

Think this will work?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to