Giter Club home page Giter Club logo

Comments (11)

pierroo avatar pierroo commented on September 22, 2024 4

I am on react-native-share 10.0.2 with RN 0.73.4, and this issue still exists on android 14 @MateusAndrade
image

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.

jsg2021 avatar jsg2021 commented on September 22, 2024 2

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.

MateusAndrade avatar MateusAndrade commented on September 22, 2024 1

🎉 This issue has been resolved in version 10.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from react-native-share.

jael0x avatar jael0x commented on September 22, 2024 1

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.

AptypTheKing avatar AptypTheKing commented on September 22, 2024

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.

ThushalIntervest avatar ThushalIntervest commented on September 22, 2024

@AptypTheKing Thank you 🙏 ✅. I also found a solution for this from React native release.
facebook/react-native@177d97d

from react-native-share.

trilam1409 avatar trilam1409 commented on September 22, 2024

@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.

jsg2021 avatar jsg2021 commented on September 22, 2024

@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.

GSSPawanKumarSingh avatar GSSPawanKumarSingh commented on September 22, 2024

facing the same issue in my project as well. What exact config need to be done?.

from react-native-share.

pierroo avatar pierroo commented on September 22, 2024

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.

1ashishkhanna avatar 1ashishkhanna commented on September 22, 2024

I am on react-native-share 10.0.2 with RN 0.73.4, and this issue still exists on android 14 @MateusAndrade image

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.