Comments (11)
I am on react-native-share 10.0.2 with RN 0.73.4, and this issue still exists on android 14 @MateusAndrade
what am I missing?
EDIT: my bad, apparently it may be due to react-native-iap that's also raising the same issue
from react-native-share.
This fixes it for me:
--- a/node_modules/react-native-share/android/src/main/java/cl/json/social/TargetChosenReceiver.java
+++ b/node_modules/react-native-share/android/src/main/java/cl/json/social/TargetChosenReceiver.java
@@ -46,7 +46,7 @@ public class TargetChosenReceiver extends BroadcastReceiver {
context.unregisterReceiver(sLastRegisteredReceiver);
}
sLastRegisteredReceiver = new TargetChosenReceiver();
- context.registerReceiver(sLastRegisteredReceiver, new IntentFilter(sTargetChosenReceiveAction));
+ context.registerReceiver(sLastRegisteredReceiver, new IntentFilter(sTargetChosenReceiveAction), Context.RECEIVER_EXPORTED);
}
Intent intent = new Intent(sTargetChosenReceiveAction);
from react-native-share.
🎉 This issue has been resolved in version 10.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from react-native-share.
I had the same issue, with the package react-native-settings in the RNSettingsModule.java file, but fixed with this patch
diff --git a/node_modules/react-native-settings/android/build.gradle b/node_modules/react-native-settings/android/build.gradle
index 6f8e7d0..f85c9dd 100644
--- a/node_modules/react-native-settings/android/build.gradle
+++ b/node_modules/react-native-settings/android/build.gradle
@@ -1,6 +1,7 @@
buildscript {
repositories {
google()
+ jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
diff --git a/node_modules/react-native-settings/android/src/main/java/io/rumors/reactnativesettings/RNSettingsModule.java b/node_modules/react-native-settings/android/src/main/java/io/rumors/reactnativesettings/RNSettingsModule.java
index b0f44c5..84a017c 100644
--- a/node_modules/react-native-settings/android/src/main/java/io/rumors/reactnativesettings/RNSettingsModule.java
+++ b/node_modules/react-native-settings/android/src/main/java/io/rumors/reactnativesettings/RNSettingsModule.java
@@ -1,6 +1,7 @@
package io.rumors.reactnativesettings;
+import android.os.Build;
import android.provider.Settings;
import android.content.Intent;
import android.content.IntentFilter;
@@ -91,7 +92,11 @@ public class RNSettingsModule extends ReactContextBaseJavaModule {
private void registerReceiver(Context reactContext, String filter, BroadcastReceiver receiver) {
IntentFilter intentFilter = new IntentFilter(filter);
- reactContext.registerReceiver(receiver, intentFilter);
+ if (Build.VERSION.SDK_INT >= 34 && reactContext.getApplicationInfo().targetSdkVersion >= 34) {
+ reactContext.registerReceiver(receiver, intentFilter, Context.RECEIVER_EXPORTED);
+ } else {
+ reactContext.registerReceiver(receiver, intentFilter);
+ }
}
private void initReceivers() {
from react-native-share.
Android 14 need to specify the receiver. You need to patch the lib:
diff --git a/node_modules/react-native-orientation-locker/android/src/main/java/org/wonday/orientation/OrientationModule.java b/node_modules/react-native-orientation-locker/android/src/main/java/org/wonday/orientation/OrientationModule.java
index 4a44ff6..3916d49 100644
--- a/node_modules/react-native-orientation-locker/android/src/main/java/org/wonday/orientation/OrientationModule.java
+++ b/node_modules/react-native-orientation-locker/android/src/main/java/org/wonday/orientation/OrientationModule.java
@@ -353,7 +353,7 @@ public class OrientationModule extends ReactContextBaseJavaModule implements Ori
public void start() {
FLog.i(ReactConstants.TAG, "orientation detect enabled.");
mOrientationListener.enable();
- ctx.registerReceiver(mReceiver, new IntentFilter("onConfigurationChanged"));
+ ctx.registerReceiver(mReceiver, new IntentFilter("onConfigurationChanged"), ctx.RECEIVER_NOT_EXPORTED);
}
Or manually add the ctx.RECEIVER_NOT_EXPORTED
to the ctx.registerReceiver
and then patch the lib, it will create same file
from react-native-share.
@AptypTheKing Thank you 🙏 ✅. I also found a solution for this from React native release.
facebook/react-native@177d97d
from react-native-share.
@AptypTheKing Thank you 🙏 ✅. I also found a solution for this from React native release. facebook/react-native@177d97d
It doesn't work for me
from react-native-share.
@AptypTheKing Thank you 🙏 ✅. I also found a solution for this from React native release. facebook/react-native@177d97d
It doesn't work for me
That exact change won't. It was an example of what to fix in this project. This line needs updating:
https://github.com/react-native-share/react-native-share/blob/main/android/src/main/java/cl/json/social/TargetChosenReceiver.java#L49
from react-native-share.
facing the same issue in my project as well. What exact config need to be done?.
from react-native-share.
facing the same issue in my project as well. What exact config need to be done?.
There isn't any config needed, just make sure to use their latest version that's compatible with android 14.
On the other hand, like myself make sure it's related to this library and not a different one which might trigger the same issue (and also need to be upgraded)
from react-native-share.
I am on react-native-share 10.0.2 with RN 0.73.4, and this issue still exists on android 14 @MateusAndrade
what am I missing?
EDIT: my bad, apparently it may be due to react-native-iap that's also raising the same issue
same issue i'm facing
from react-native-share.
Related Issues (20)
- ShareSingle's result.success immediately resolving as false HOT 4
- Im getting Same Issue . Facebook is Installed in my device , But Still Getting Not Installed and opening in browser. HOT 4
- SMS on iOS fails to open HOT 2
- File sharing from internal storage to external storage - Android 14 HOT 1
- Does this library support the sharing method using App extension libiary? HOT 2
- "Save" button is white, not clear HOT 1
- Share.open saying it needs 3 arguments and only received 1 - ios HOT 1
- shareSingle fb messenger on IOS, empty link and no preview HOT 2
- TargetChosenReceiver.getSharingSenderIntent
- Share button doesn't do anything on Android HOT 4
- Facebook opens in browser, X, both broken. HOT 3
- Unable to share multiple PDF and DOC files to Slack from React Native app. HOT 1
- shareResponse always returning false.
- Sharing PDF File On Whatsapp Error On IOS In Release Build HOT 2
- Share.open exclude message for instagram HOT 2
- share button doesnt do anythinn in android 14
- Cannot run build ios with use_framework static
- Specify zoom of picture when sharing to instagram stories
- Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNShare' could not be found. HOT 2
- Share.shareSingle `Instagram` only opens AppStore, does not post to Instagram HOT 8
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.