20

I created a Today Extension that is introduced in iOS 8 first time. To share data between Today extension and it's container App, I defined an app group, and bind them to this group. (Actually I added an embedded framework also to re-use code in both side.)

Details of this method is described in Apple's document.

I created some core data model and store it as sqlite on group container. Then everything works as I thought.

However, when I uninstall container app, There are still shared container and it's content on my iPhone. I think when last member of app group is uninstalled, this container should have to be deleted automatically. In my case, members of app group are shipped with just a single app, So, uninstalling this app should have to clear shared container.

Am I wrong?

ps. I could not find a way to delete this shared container as an user. Only developer who has rights to access app-group can remove this container with programming.

codester
  • 36,891
  • 10
  • 74
  • 72
jeeeyul
  • 3,727
  • 1
  • 24
  • 37

2 Answers2

7

In iOS8 beta 4, App group container is deleted automatically when the last app that is belongs to the group is uninstalled,

So, it was just a bug that is now fixed by Apple.

jeeeyul
  • 3,727
  • 1
  • 24
  • 37
  • 2
    Not fixed here with Xcode 6 GM. Deleting app does not remove its app container data on the simulator. – bauerMusic Sep 15 '14 at 10:01
  • 4
    Is there any documentation to back this up? – Jason May 06 '15 at 23:59
  • It is mentionned here https://developer.apple.com/documentation/foundation/nsfilemanager/1412643-containerurlforsecurityapplicati?language=objc at the bottom – yageek Sep 16 '21 at 15:25
0

As precised inside the documentation of containerURLForSecurityApplicationGroupIdentifier: (behavior is different whether you are on macOS or iOS)

Unlike in macOS, when all the apps in a given app group are removed from the device, the system detects this condition and removes the corresponding group directory as well.

So the answer to your question is no.

yageek
  • 4,115
  • 3
  • 30
  • 48