iOS - How to pass string from main app to widget without using app group

268 Views Asked by At

As title, have any idea let widget get main app data?
As I know using App group to save & load the same suite userdefault.
Does have another way to achieve this feature?
Thanks.

1

There are 1 best solutions below

0
Frantiesco Masutti On

AFAIK as you just mentioned the App groups is the way to go when sharing content between your main App and your widget.

Apple is really restrict about user data safety, and don't think there is there any other way to share content without using the app group as we can see on their documentation available here (Sharing Data with Your Containing App)

Something that would try is using a local notification I think this might work to trigger a local notification to your extension and handle the string on the other side :)

More details available here