Comments (10)
@sanghaya actually even if you install AsyncStorage
on your extension, you won't be sharing the storage between your app and your extension, because they reside in different places on the disk. There's an issue on @react-native-community/AsyncStorage
discussing this, but this hasn't been implemented since I last checked. In my case, I was already using WatermelonDB so I managed to share the db across the app and extension on iOS via an App Group
from react-native-share-menu.
@thiagobrez I'm not sure for that specific workflow. Have you checked if the native portion of those libraries support App Group User Defaults?
Btw, I'm closing this issue in the meantime because I've had confirmation from someone that linking the pods manually on the Share Extension target fixes this issue.
If you have other unrelated issues please open a new issue for those.
from react-native-share-menu.
Hey, what I mean by linking is adding the pod to the share extension target in the Podfile
Hi @Gustash thanks in advance. When you say adding the pod to the Podfile, do you mean something like below and running pod install? Is there any other required step?
target 'ShareExtension' do
use_react_native!
pod 'RNShareMenu', :path => '../node_modules/react-native-share-menu'
pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-async-storage/async-storage'
# Manually link packages here to keep your extension bundle size minimal
end
And then after running pod install, you would see something like this in your CLI. Is this correct?
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- @react-native-async-storage/async-storage (to unlink run: "react-native unlink @react-native-async-storage/async-storage")
- react-native-share-menu (to unlink run: "react-native unlink react-native-share-menu")
from react-native-share-menu.
You can share all the code you want. The error you're getting is because you need to manually link the AsyncStorage package in your share module target. Autolinking is disabled for the share module in order to keep the bundle size minimal
from react-native-share-menu.
So I've followed these instructions https://react-native-community.github.io/async-storage/docs/link/ and linked it with ShareExtensions Build Phase
and I'm currently ending with an iOS build error.
Should I do some specific linking?
from react-native-share-menu.
Hey, what I mean by linking is adding the pod to the share extension target in the Podfile
from react-native-share-menu.
I'm having a similar problem, followed the solution and added the packages I needed but now it says Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>
I have tried wrapping my Share component in a Provider but still getting the error
from react-native-share-menu.
@CptMaumau I faced this yesterday but solved by wrapping it in a Provider indeed. Maybe your AppRegistry.registerComponent
is pointing to the wrong function? Also, I only managed to register the extension by calling it from index.share.js
from react-native-share-menu.
Hey @Gustash, I'm trying to share my main app database (Watermelon / SQLite) with the Share Extension. I've already linked it to the extension target and can use it successfully, but another database instance is being created, as if it can't find the db file. I see that in ShareViewController.swift
there are already some handling code for iOS Shared Containers, UserDefaults
, etc. Can you point me in the right direction?
from react-native-share-menu.
Is it possible to share the logic between them, or any way to achieve the following:
- Access hooks from Main app
- Access AsyncStorage in Share.js from Main app
- Import third-party packages to Share.js (e.g. Apollo)
I tried adding the AsyncStorage directly to the Share.js but I get this error:
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
I think I would also be ok if there is a way to have a separated package.json for Share.js if necessary, but @Gustash maybe you can put some more light on this topic?
Did anyone manage to solve this? I re-installed AsyncStorage to the latest version and manually added to Podfile under ShareExtension after I wrapped the file in Provider. But I'm still having this issue.
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
from react-native-share-menu.
Related Issues (20)
- Share intent for multiple links crashing
- Issue While Building the app after installation HOT 2
- CustomView not opening for iOS
- ShareMenuReactView.continueInApp causes origin app to freeze
- Out of memory crashes are more frequent on iOS 17 when sharing certain URLs HOT 6
- Update example project
- Support "No Share Extension UI" flow on iOS HOT 2
- Add a privacy manifest for XCode 15
- Improve app group configuration for iOS
- Set up changelog format
- Do a test release HOT 1
- Ensure iOS share extension can load files of all types, from all apps
- Report content types more clearly (Android and iOS)
- Add a method to manage copied files on iOS
- Add support for the New Architecture
- v7.0 Tracking issue
- Anyone get this working with Expo? HOT 1
- Build failed HOT 2
- iOS: Skip / don't show dialog, jump into app directly HOT 1
- iOS app is not building with new architecture in react native 0.72.6 HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-share-menu.