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

[iOS] So far, only UserDefault can be used to share data with the main runner? #206

Open
BenderBlog opened this issue Jan 14, 2024 · 0 comments

Comments

@BenderBlog
Copy link

Just curious, not bug. This plugin is awesome!

To be clear, a Swift beginner...

In Apple devices, we have to use groupid to share data between the main app and HomeWidget, UserDefault is used in this plugin. My data is too huge (related to schedule data, about 10kb), maybe too huge to put it in the UserDefault. Although I use background_fetch to update the plugin every 15 minute, somebody said that it may be killed sometimes. Don't know whether it is true, but I was thinking, could I read data from the main app, via groupid?

Since groupid is used, I tried to use an alternative way, by reading the shared data folder:

let appSupportURL = FileManager().containerURL(forSecurityApplicationGroupIdentifier: widgetGroupId)!

By the way, the data I read is stored in Application Support Directory as defined by path_provider plugin. And unfortunately, it failed, saying that these two folder is not the same. Application Support Directory means the private main runner data, it seems...

e8a1e572f0d65edc960064389bbec785

So, is there anyway to store data to the shared folder in the main runner, the Flutter code? I mean, since groupid provided...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant