Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to share custom data between iPhone applications?

If I make two iPhone applications, how can/should I share custom data (not contacts and stuff like that) among them?

Thanks!

like image 795
Robert Gould Avatar asked Oct 21 '08 03:10

Robert Gould


People also ask

How do I share data between two iOS apps?

Use a shared app group to share data/files between two/more apps or containing apps. An app group creates a secure container that multiple processes can access. Normally, each process runs in its own sandbox environment, but an app group lets both processes share a common directory.

Can we copy apps and settings from one iPhone to another?

You can transfer all your apps to a new iPhone from an iCloud backup during initial setup. Before transferring the apps using iCloud, make sure you've made an iCloud backup of your old phone. You can also use the App Store to choose which apps you'd like to download on your new iPhone.

How do I share content between iphones?

Wirelessly, with email, messages, or AirDrop: You can use email, messages, and AirDrop to send files to yourself from one device and download them on another. See Transfer files wirelessly between your iPhone and computer with email, messages, or AirDrop.


2 Answers

There are two different ways you might go about this.

1) The data you need to share is non-persistent. In other words you need to launch one application with a piece of data that it can do something with. In this case you would register a special URL scheme per application.

You can find out more information about URL schemes via Craig Hockenberry in his [redacted] blog post.

2) The data you need to share is persistent. In other words you need something like a data file that both applications can read and write too. As far as I know there isn't a safe way to do this other than storing your data on a remote server. If you need the data accessible without a data connection then you would need to figure out a way to sync data between the individual apps and the remote server.

like image 177
Michael Ledford Avatar answered Sep 23 '22 17:09

Michael Ledford


In addition to what's already been mentioned, the iPhone documentation on code signing seems to imply that applications signed with the same identity can access the same Keychain items. If you need to store relatively small amounts of data (passwords, etc), this may be a useful technique.

like image 22
Mark Bessey Avatar answered Sep 23 '22 17:09

Mark Bessey