Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it good approach to save Realm file in AppGroup's shared Container #4899

Closed
SureshSc opened this issue Apr 25, 2017 · 7 comments
Closed
Assignees
Labels

Comments

@SureshSc
Copy link

SureshSc commented Apr 25, 2017

Hi,

I have a very basic question regard saving the .realm file in appgroup's shared container.
i asked this question in stackoverflow as well.

Some one please help me.
http://stackoverflow.com/questions/43609213/is-it-good-approach-to-keep-database-in-appgroups-shared-container

I am using Realm in my application as database and i am having share extension to support media to be share from other application. Since i need my database to be accessed from share extension i moved realm file from App's document directory to Appgroup's shared container. I have below questions.

  1. Is it safe to store the database in shared container space.
  2. When i uninstall the app, still files inside shared container persist, so when the shared container will be deleted.
  3. Any other best practices to handle my scenario.
@karapigeon
Copy link

It seems you've deleted your SO question. Please repost your question and we will follow-up on Stack Overflow. We prefer to answer these kinds of questions on there.

@bdash
Copy link
Contributor

bdash commented Apr 25, 2017

The Markdown syntax for the link to the question was bogus, causing a 404 when following the link. I've edited the original comment to correct the link.

@karapigeon
Copy link

Ah my bad.

@SureshSc
Copy link
Author

@jpsim
Copy link
Contributor

jpsim commented Apr 25, 2017

  1. Is it safe to store the database in shared container space.

Yes. In fact it's the only way to share files across processes on iOS.

  1. When i uninstall the app, still files inside shared container persist, so when the shared container will be deleted.

According to http://stackoverflow.com/a/25027088/373262, iOS deletes shared containers once the last app to have access to it is removed from the device.

If you find situations in which this doesn't happen, I encourage you to file a radar to inform Apple about the bug. https://bugreport.apple.com

  1. Any other best practices to handle my scenario.

Sounds like you're doing everything right. Keep it up! 👌

@SureshSc
Copy link
Author

Thank a lot @jpsim

@inPhilly
Copy link

Except that sync cannot happen from the shared appGroup container, right?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants