Giter Site home page Giter Site logo

syeed111 / react-native-expo-read-sms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maniac-tech/react-native-expo-read-sms

0.0 0.0 0.0 273 KB

Library to read incoming SMS in Android for Expo (React Native)

Home Page: http://maniac-tech.com/expo-read-sms/

License: MIT License

JavaScript 35.16% Java 64.84%

react-native-expo-read-sms's Introduction

react-native-expo-read-sms / Webpage

Maintainers

maniac-tech Active maintainer

Installation

Install this in your managed Expo project by running this command:

$ npm install @maniac-tech/react-native-expo-read-sms --save

Usage

  1. Import the startReadSMS function after installation

    import { startReadSMS } from "@maniac-tech/react-native-expo-read-sms";

  2. Pass Success and Error callbacks startReadSMS(successCallbackFn, errorCallbackFn)

  3. Everytime an SMS has been received successCallbackFn will be called with the sms

Example

You may refer to this sample application for how to use the library: GitHub Repo

Methods

Method name Description Params Returns
checkIfHasSMSPermission Function which checks if the application has READ_SMS and RECEIVE_SMS permissions - { hasReceiveSmsPermission: true/false, hasReadSmsPermission: true/false }
requestReadSMSPermission Requests READ_SMS and RECEIVE_SMS permission, if missing - Returns true if granted, and false otherwise
startReadSMS Starts listening for incoming messages. Note: SMS Permissions should be present. callback fn Return a string with message orginating address, and message body. Example: [+919999999999, this is a sample message body]

Important Note:

Ensure your app has READ_SMS, and RECEIVE_SMS, failing which you'll receive error on calling the function

Support

Tested on Expo SDK v44, v45 & v47 and Node JS v14

License

MIT

react-native-expo-read-sms's People

Contributors

maniac-tech avatar

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.