Comments (10)
Same issue
"react-native": "0.62.2", "react-native-share": "^3.3.2"
from react-native-share.
I think this problem has been fixed in v7.0.1.
Or is there some other problem?
from react-native-share.
@yaeda that also fixes it with better code, thank you!
But, I am using an older version of react-native-share and cannot update at the moment so need to do it in a patch.
from react-native-share.
I think this problem has been fixed in v7.0.1.
Or is there some other problem?
Thanks @yaeda Fixed here
from react-native-share.
Same issue
from react-native-share.
I fixed the issue by adding the following code to the AndroidManifest.xml file.
<queries>
<package android:name="com.example.store" />
<package android:name="com.example.services" />
<!--for example, to share via instagram -->
<package android:name="com.instagram.android" />
<package android:name="com.whatsapp.android" />
<intent>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="image/jpeg" />
</intent>
</queries>
And
const shareOptions = {
url: uri,
social: Share.Social.WHATSAPP,
};
Share.shareSingle(shareOptions);
But it only shares on WhatsApp.
The error persists when using the Share.open() function.
from react-native-share.
any updates? how to fix this issue??
from react-native-share.
Same issue
from react-native-share.
Found a fix, you have to go into react-native-share/android/src/main/java/cl/json/social/TargetChosenReceiver.java and change to the code below. Then use a library like patch-package to save the patch so it works on every npm install...
This...
Intent intent = new Intent(sTargetChosenReceiveAction);
intent.setPackage(reactContext.getPackageName());
intent.putExtra(EXTRA_RECEIVER_TOKEN, sLastRegisteredReceiver.hashCode());
final PendingIntent callback = PendingIntent.getBroadcast(reactContext, 0, intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);```
To...
Intent intent = new Intent(sTargetChosenReceiveAction);
intent.setPackage(reactContext.getPackageName());
intent.setClass(reactContext, TargetChosenReceiver.class);
intent.putExtra(EXTRA_RECEIVER_TOKEN, sLastRegisteredReceiver.hashCode());
final PendingIntent callback;
if (android.os.Build.VERSION.SDK_INT >= 23) {
callback = PendingIntent.getBroadcast(reactContext, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} else {
callback = PendingIntent.getBroadcast(reactContext, 0, intent,
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_ONE_SHOT);
}
from react-native-share.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open
from react-native-share.
Related Issues (20)
- after update I cannot compile my project HOT 2
- string not assignable to type Social HOT 4
- iOS shareSingle js code migrated to promise, but native still returns a tuple used for callbacks HOT 1
- Exclude own (Ios) app from sharesheet? HOT 2
- canOpenURL reports wrong value for ig stories url HOT 4
- Exclude own (Ios) app from sharesheet? HOT 1
- Share.shareSingle not working HOT 4
- URL icons don't work at all HOT 2
- Share didn't seem work if device has the Instagram Lite app, does this package support? HOT 1
- Image not sharing to WhatsApp HOT 4
- Permission issue at AndroidTV 10 HOT 1
- Cant send video to whatsapp HOT 2
- The File Format not supported Error HOT 2
- shareSingle does not work with multiple emails on iOS HOT 1
- root path security issue HOT 2
- Black screen on iOS when Share.open and then choosing Instagram story on iOS HOT 15
- when sharing a video to whatsapp a message is required on iOS, but not in types HOT 2
- Share menu suggestion applications are missing HOT 1
- Sending a URL along with a message does not work on IOS, only on Android. HOT 5
- [windows] LINK : fatal error LNK1104: cannot open file 'hermes.lib' HOT 1
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.