andrewz
andrewz

Reputation: 5220

Sharing data between apps on iOS

I have several small apps that share common data (images, sounds files, etc). This data bloats the size of each app. When the user installs 2 or more of these apps that will bloat the device space with duplicate data. Is there a way that I can share this data between my apps so that each app doesn't duplicate this data within its bundle?

Upvotes: 1

Views: 4333

Answers (2)

Nordeast
Nordeast

Reputation: 1373

You can have a common file space between apps by using app groups. An example of how to use them can be found here: Sharing data in between apps in IOS

You can use this as part of a solve for not duplicating the data in every bundle. One way might be to have the data hosted on a server somewhere and when the app is installed you can check the App Group for the common data, if it is not there, you can download it and store it there. Then the next app that is installed will have the data already available. This should help avoid having to include it in every small app.

You can set up the code to check the shared location and download the data in a framework and share it between all your apps making it a bit easier to maintain. If you do not already have a content management system then you could google for a few that have iOS support. There are many out there. You would then host the shared data there. This would give you the ability to update the data for each app while they are in the field which could be a time saver. If these apps are very small though, this may be overkill.

Upvotes: 3

stakri
stakri

Reputation: 1397

No, this is not currently possible. Ideally, this kind of resource-sharing would require creating a common framework bundle that would have to be submitted separately to the App Store as a third-party framework, so that even if only one of your apps is present on the device, it would be able to load the appropriate resources and function properly.

Apple currently only allows third-party frameworks embedded within the app bundle. Even if two of your apps use the same exact version of your framework, they have to embed it separately.

Upvotes: -1

Related Questions