Open sonirad88 opened 6 years ago
Might need to make a PR to help clarify the docs and add some images; will try to make some time early in the week. The extension and main app containers are isolated from one another. You will need to create an app group with your Apple Developer account. See "Adding an App to an App Group". Then, they can use a shared container. See "Sharing Data with Your Containing App".
Without looking, I'm pretty sure AsyncStorage is local to the app's container, without support for shared containers. You can use something like react-native-fs to replace AsyncStorage. There are other options too, but that should be a good starting point.
react-native-xcode.sh
is called from. Not sure if it's changed in the latest create-react-native-app implementation; can look later.
cp-native-assets
npm script would just be an in-house script that copies assets that are needed in the share extension react-native app. Likely unnecessary, could probably update the docs with an example or strip that altogether, depending on what makes most sense. Will look at this soon.@sonirad88 Let me know if you have further questions. I can try to clarify more, if necessary.
Thanks @TheTekton for good explanation. I thought that shared bundles will help me use AsyncStorage for both my extension and main app but now i see that only option to me is open App Group. Im waiting for my developer account so i can create group and probably i will use this library from alinz 'react-native-swiss-knife' (probably i will change instead string to store array/dictionary). I hope that i can also store files in that shared container of app group because my extension and main app should be able store .pdf files that can be visible for both (as i can see now they store file in different place). FYI im not iOs dev :)
what is the solution to use asyncStorage with main app and share extension ??
Hi. I need solution where my extension and main app will share same storage (use AsyncStorage). Guess shared bundles will help me achieve that? Following the steps i stop on two issues: