Giter VIP home page Giter VIP logo

rn-sms-retriever's Introduction

Hi there ๐Ÿ‘‹

I am Arpan Sharma, a mobile applications developer(React Native) since 2016. I have interest in learning latest concepts related to technology. I have worked on a few react native packages (rn-braintree-one, rn-sms-retriever) which you can checkout.

(y)

rn-sms-retriever's People

Contributors

andrewgrinko avatar arpansharma7474 avatar arpanzap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rn-sms-retriever's Issues

requiresMainQueueSetup

Module RnSmsRetriever requires main queue setup since it overrides init but doesn't implement requiresMainQueueSetup. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.

Not working on Expo Application

it shows [Unhandled promise rejection: TypeError: null is not an object (evaluating '_rnSmsRetriever.default.SMS_EVENT')]

IOS Example ?

hi, i like your work. but i saw the libary ios project. Is this already library support for ios too ?
any example of that ? but the read me has note, only use in android.

react-native 0.73 compatibility

Hello, while I don't use this library in our project (we are using react-native-sms-retriever instead), I noticed that this is basically a fork of that library, and the issue probably applies to this library as well.

When I was upgrading our project to react-native 0.73, I noticed that the sms retriever was not working, and with some debugging I found the reason: https://stackoverflow.com/a/77276774/17101184

Based on this answer, I made a patch for the original library. As I cannot publish it in that repo anymore (it was archived and is read-only now), I'm posting it here in the hopes that somebody using either of these libraries find this and it saves them some time:

diff --git a/node_modules/react-native-sms-retriever/android/src/main/java/me/furtado/smsretriever/SmsHelper.java b/node_modules/react-native-sms-retriever/android/src/main/java/me/furtado/smsretriever/SmsHelper.java
index b1ab5f4..5495d66 100644
--- a/node_modules/react-native-sms-retriever/android/src/main/java/me/furtado/smsretriever/SmsHelper.java
+++ b/node_modules/react-native-sms-retriever/android/src/main/java/me/furtado/smsretriever/SmsHelper.java
@@ -1,7 +1,11 @@
 package me.furtado.smsretriever;
 
+import static android.content.Context.RECEIVER_EXPORTED;
+
 import android.content.BroadcastReceiver;
 import android.content.IntentFilter;
+import android.os.Build;
+
 import androidx.annotation.NonNull;
 
 import com.facebook.react.bridge.Promise;
@@ -57,7 +61,11 @@ final class SmsHelper {
         final IntentFilter intentFilter = new IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION);
 
         try {
-            mContext.registerReceiver(mReceiver, intentFilter);
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+                mContext.registerReceiver(mReceiver, intentFilter, RECEIVER_EXPORTED);
+            } else {
+                mContext.registerReceiver(mReceiver, intentFilter);
+            }
             return true;
         } catch (Exception e) {
             e.printStackTrace();

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.