Comments (4)
Humm try this please:
componentWillUpdate() { ShareMenu.getSharedText((text) => { console.log(text); }); }
from react-native-share-menu.
Unfortunately, using componentWillUpdate()
doesn't help:
- On the one hand, it now gets triggered way too often, namely on any screen update, even if I just change a Picker value.
- On the other hand, still nothing happens when I call the share action from another app while my app is running.
Interestingly, even the following is the case:
- Let's say my app is not running and I share the text
foo
to my app. Then my app starts, and with the code incomponentWillUpdate()
, I seefoo
– as it should be. - But now, if I share from the other app
bar
, at first nothing happens. Then, If I cause a component update (for instance by changing a Picker value), the text fromShareMenu.getSharedText
is stillfoo
.
I guess we must somehow tie this code to a event, no? Maybe according to Linking, add an event listener, so that it's possible to write
addEventListener('text', this._handleTextShare);
no?
BTW: I'm testing on Android 6.0.1.
from react-native-share-menu.
So I could solve the problem for me with setting
android:launchMode="singleTop"
within AndroidManifest.xml
. Context:
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
...
from react-native-share-menu.
I just fixed this on version 2.0.0. I basically had to implement onNewIntent
on the module code. In my code I also had to implement some logic to get the latest intent when the app comes to foreground: https://github.com/meedan/check-mark/blob/150f88fb83f08d41a0530827d5a02a544859f3ed/index.js#L70-L110.
from react-native-share-menu.
Related Issues (20)
- Show more than one options (Post, Community, Activity, Event) while sharing images from gallery HOT 1
- 'openURL:options:completionHandler:' is unavailable: not available on iOS
- Crash on Android 12
- Android Manual Steps
- 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
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.