Git Product home page Git Product logo

react-native-get-sms-android's Introduction

react-native-get-sms-android

Module that supports interaction with the Messaging API on Android

The package allows you to:

  • get messages
  • send messages
  • delete messages

Decided to start this package because react-native-android-sms wasn't maintained at the time.


Getting started

Yarn

$ yarn add react-native-get-sms-android

Npm

$ npm install react-native-get-sms-android --save

Mostly automatic installation

$ react-native link react-native-get-sms-android

Manual installation

android/settings.gradle

include ':react-native-get-sms-android'
project(':react-native-get-sms-android').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-get-sms-android/android')

android/app/build.gradle

dependencies{
    compile project(':react-native-get-sms-android')
 }

MainApplication.java

import com.react.SmsPackage;

@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
    new MainReactPackage(),
    new SmsPackage()
    // (...)
  );
}

Android Permissions

Note: This has changed from 2.x. See Upgrading to 2.x section if using <=2.x

Add permissions to your android/app/src/main/AndroidManifest.xml file.

...
  <uses-permission android:name="android.permission.READ_SMS" />
  <uses-permission android:name="android.permission.WRITE_SMS" />
  <uses-permission android:name="android.permission.SEND_SMS" />
...

Upgrading to 2.x

You need to add permissions manually. react-native-get-sms-android does not automatically require permissions from 2.x. Refer to this issue.

You need to require permissions in your AndroidManifest.xml file's application element based on what functions you plan to use like the official documentation describes:

Function Permission needed
SmsAndroid.list android.permission.READ_SMS
SmsAndroid.delete android.permission.WRITE_SMS
SmsAndroid.autoSend android.permission.SEND_SMS

Usage

List SMS Messages

import SmsAndroid from 'react-native-get-sms-android';

/* List SMS messages matching the filter */
var filter = {
  box: 'inbox', // 'inbox' (default), 'sent', 'draft', 'outbox', 'failed', 'queued', and '' for all

  /**
   *  the next 3 filters can work together, they are AND-ed
   *  
   *  minDate, maxDate filters work like this:
   *    - If and only if you set a maxDate, it's like executing this SQL query:
   *    "SELECT * from messages WHERE (other filters) AND date <= maxDate"
   *    - Same for minDate but with "date >= minDate"
   */
  minDate: 1554636310165, // timestamp (in milliseconds since UNIX epoch)
  maxDate: 1556277910456, // timestamp (in milliseconds since UNIX epoch)
  bodyRegex: '(.*)How are you(.*)', // content regex to match

  /** the next 5 filters should NOT be used together, they are OR-ed so pick one **/
  read: 0, // 0 for unread SMS, 1 for SMS already read
  _id: 1234, // specify the msg id
  thread_id: 12, // specify the conversation thread_id
  address: '+1888------', // sender's phone number
  body: 'How are you', // content to match
  /** the next 2 filters can be used for pagination **/
  indexFrom: 0, // start from index 0
  maxCount: 10, // count of SMS to return each time
};

SmsAndroid.list(
  JSON.stringify(filter),
  (fail) => {
    console.log('Failed with this error: ' + fail);
  },
  (count, smsList) => {
    console.log('Count: ', count);
    console.log('List: ', smsList);
    var arr = JSON.parse(smsList);

    arr.forEach(function(object) {
      console.log('Object: ' + object);
      console.log('-->' + object.date);
      console.log('-->' + object.body);
    });
  },
);

/*
Each sms will be represents by a JSON object represented below

{
  "_id": 1234,
  "thread_id": 3,
  "address": "2900",
  "person": -1,
  "date": 1365053816196,
  "date_sent": 0,
  "protocol": 0,
  "read": 1,
  "status": -1,
  "type": 1,
  "body": "Hello There, I am an SMS",
  "service_center": "+60162999922",
  "locked": 0,
  "error_code": -1,
  "sub_id": -1,
  "seen": 1,
  "deletable": 0,
  "sim_slot": 0,
  "hidden": 0,
  "app_id": 0,
  "msg_id": 0,
  "reserved": 0,
  "pri": 0,
  "teleservice_id": 0,
  "svc_cmd": 0,
  "roam_pending": 0,
  "spam_report": 0,
  "secret_mode": 0,
  "safe_message": 0,
  "favorite": 0
}

*/

Delete SMS Message

Delete an sms with id. If the message with the specified id does not exist it will fail with error: SMS not found

import SmsAndroid from 'react-native-get-sms-android';

SmsAndroid.delete(
  _id,
  (fail) => {
    console.log('Failed with this error: ' + fail);
  },
  (success) => {
    console.log('SMS deleted successfully');
  },
);

Important note on deleting messages

For Android > 5, the only app permitted to delete an SMS message is the app installed as the default SMS handler.

If your app is not set as the default SMS handler, it will not be able to delete. See this thread on Stack Overflow for more details.

Send SMS Message (automatically)

Send an sms directly with React without user interaction.

import SmsAndroid from 'react-native-get-sms-android';

SmsAndroid.autoSend(
  phoneNumber,
  message,
  (fail) => {
    console.log('Failed with this error: ' + fail);
  },
  (success) => {
    console.log('SMS sent successfully');
  },
);

Send message to multiple numbers

import SmsAndroid from 'react-native-get-sms-android';

let phoneNumbers = {
  "addressList": ["123", "456"]
};

SmsAndroid.autoSend(
  JSON.stringify(phoneNumbers),
  message,
  (fail) => {
    console.log('Failed with this error: ' + fail);
  },
  (success) => {
    console.log('SMS sent successfully');
  },
);

Event listeners

An event will be thrown when the sms has been delivered. If the sms was delivered successfully the message will be "SMS delivered" otherwise the message will be "SMS not delivered"

import { DeviceEventEmitter } from 'react-native';

DeviceEventEmitter.addListener('sms_onDelivery', (msg) => {
  console.log(msg);
});

Note

  • Does not work with Expo as it's not possible to include custom native modules beyond the React Native APIs and components that are available in the Expo client app. The information here might help with integrating the module while still using Expo.

Contributions welcome!

Feel free to open an issue or a Pull Request.

Thanks

react-native-get-sms-android's People

Contributors

avikantwadhwa avatar briankabiro avatar davidstoneham avatar dependabot[bot] avatar figgcoder avatar joao-lourenco avatar mikehardy avatar olivierfreyssinet avatar paurakhsharma avatar quantum-35 avatar tahins avatar tapanprakasht avatar tvc97 avatar windastella avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-native-get-sms-android's Issues

null is not an object at basic example

Hi,

I'm a complete noob at building android application but I want to use react-native-get-sms-android to read sms only.

What I did :

  • react-native init myapp
  • cd myapp
  • yarn add react-native-get-sms-android
  • Add all permissions in android/app/src/main/AndroidManifest.xml
  • Copy from here to myapp/App.js just to get a working example
  • Launch android virtual device (Nexus one API 28)
  • Once virtual device is ready : react-native run-android

The app gets correctly loaded into the virtual device. I allow ,through the popup, my app to read sms. And then the crash :
null is not an object (evaluating '_reactNativeGetSmsAndroid.default.list')

I have checked those two closed issues :

  • 36 : I assume I have correctly copy pasted from example (hope it's a working example, though!)
    12 : I assume I'm not using Expo. Am I correct ? If not, I may need an explaination.

Otherwise, I just can't get the basic example working. Where is my fault ?

send and delete sms

I'm going to send and delete my sms. i used this method to send sms

 let sms= SmsAndroid.autoSend("0966666622", "message", (fail) => {
            console.log("Failed with this error: " + fail)
        }, (success) => {
            console.log("SMS sent successfully ==>"+success);

        });
        console.log("second SMS sent successfully ==>"+sms);

and also used this method to delete sms

SmsAndroid.delete(1, (fail) => {
            console.log("Failed with this error: " + fail)
        }, (success) => {
            console.log("SMS deleted successfully");
        });

i get this error: Failed with this error: SMS not found****

i don't know how to get the sms id. in the autoSend to delete that sms.
Note: i pasted a fake number in the first delete argument!!

autoSend is not a function

Hi, I just installed this module. It is linked correctly but when I try to send a SMS I get this error:
"_reactNativeGetSmsAndroid2.default.autoSend is not a function". Why I get this error?
This is my code:
`import SmsAndroid from 'react-native-get-sms-android';

const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\n' +
'Cmd+D or shake for dev menu',
android: 'Double tap R on your keyboard to reload,\n' +
'Shake or press menu button for dev menu',
});

export default class App extends Component<{}> {

sendsms = () => {
SmsAndroid.autoSend("0966666622", "hello", (fail) => {
console.log("Failed with this error: " + fail)
}, (success) => {
console.log("SMS sent successfully");
});
}

render() {
return (

<Button title="Press" onPress={() => this.sendsms()}/>

);
}
}
`

Remove `uses-permission` from AndroidManifest.xml

Problem Statement:

I am using react-native-get-sms-android for reading sms only. Still my app asks permission for WRITE_SMS and SEND_SMS, even though I have not asked for that permission.

Cause:

The permission specified in the AndroidManifest.xml of this plugin.

Solution:

Remove the permissions from this plugin's AndroidManifest.xml and let developers add it to their app's Manifest so that there are no permissions required that the developer is not aware of.

Workaround:

Add this to your app's android/app/src/main/AndroidManifest.xml and it will remove unnecessary permission.

<uses-permission android:name="android.permission.WRITE_SMS" tools:node="remove" />
<uses-permission android:name="android.permission.SEND_SMS" tools:node="remove" />

Also add xmlns:tools to your manifest tag to work:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example">

Error: getGroupIdLevel1

I'm trying to send a sms message from physical device but i'm getting this error: Failed with this error: getGroupIdLevel1
`import SmsAndroid from 'react-native-get-sms-android';

SmsAndroid.autoSend(
phoneNumber,
message,
(fail) => {
console.log('Failed with this error: ' + fail);
},
(success) => {
console.log('SMS sent successfully');
},
);`

  • Note Works fine in Emulator

Reading MMS

Hi,
Is it possible to read MMS with this lib ?

Thanks

Crash App on device samsung

let filter = {
box: 'all',
minDate: date.valueOf(), // timestamp (in milliseconds since UNIX epoch)
indexFrom: 0, // start from index 0
maxCount: 500, // count of SMS to return each time
};
I use like this. Maybe samsung doesn't support get all sms

Unresolved function or method autoSend()

Hi i have been trying to setup SMS send in my new project but i constantly get this error: Unresolved function or method autoSend() in my IDE. On my emulator i get
Typerror:null is not an object(evaluating '_reactNativeGetSmsAndroid.default.autoSend')

Getting TypeError: undefined is not an object

I created fresh new project using create-react-native-app AwesomeProject command. then i installed the plugin and copy all the code and paste it in app.js
after that i run it into expo, and getting the following errors:

TypeError: undefined is not an object (evaluating '_reactNativeGetSmsAndroid2.default.list')

This error is located at:
    in example (at registerRootComponent.js:35)
    in RootErrorBoundary (at registerRootComponent.js:34)
    in ExpoRootComponent (at renderApplication.js:35)
    in RCTView (at View.js:78)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:78)
    in View (at AppContainer.js:122)
    in AppContainer (at renderApplication.js:34)
* App.js:33:15 in listSMS
* App.js:24:4 in example
- node_modules/react-proxy/modules/createClassProxy.js:98:23 in <unknown>
- node_modules/react-proxy/modules/createClassProxy.js:96:6 in instantiate
- ... 26 more stack frames from framework internals

SMS sent. But I DO NOT receives it on my phone!

I use the AutoSend method to send SMS. and the callback says (SMS Sent Successfully) but actually I did not receive anything to my phone.
I tried different sender provider but still not receiving the SMS (although my SMS price has been taken) . should I change receiver too?

Filter by minDate

{
"_id": 1234,
"thread_id": 3,
"address": "2900",
"person": -1,
"date": 1365053816196,
}

Will the date attribute be unique (even diff in ms).
Asking this because to fetch sms based on date filter by setting "minDate": lastReadDate +1

  • lastReadDate = Store the latest sms date value.
  • Not setting maxDate

Please advise if this would work.

Git code not tagged to correspond with npmjs.com?

This is more of a question than an issue :-)

I see on npmjs.com that the package is being updated with the work here - last publish is 1.3.8 and recently: https://www.npmjs.com/package/rn-update-get-sms-android

However, I don't see any git tags or anything here, so I'm not sure what code is in which version? In the future could you git tag vX.Y.Z and git push --tags for the corresponding commit that you npm publish ? I would appreciate it, as I appreciate all the effort here :-). Thanks

Filter not working for address

This is how my dependencies looks like

"dependencies": {
    "react": "16.8.1",
    "react-native": "0.61.2",
    "react-native-get-sms-android": "^2.0.0"
  },

I have the following filter

var filter = {
          box: 'inbox', // 'inbox' (default), 'sent', 'draft', 'outbox', 'failed', 'queued', and '' for all
          // the next 4 filters should NOT be used together, they are OR-ed so pick one
          read: 1, // 0 for unread SMS, 1 for SMS already read
          // _id: 1061, // specify the msg id
          address: 'NICA_ALERT', // sender's phone number
          // body: 'Your 166##24001 has been Debited', // content to match
          // the next 2 filters can be used for pagination
          indexFrom: 0, // start from index 0
          maxCount: 100, // count of SMS to return each time
        };

I want to get only the SMS send from NICA_ALERT but I get other messages that is not set by NICA_ALERT

Here is how I have implemented the code

await SmsAndroid.list(
          JSON.stringify(filter),
          (fail) => {
            console.log('Failed with this error: ' + fail);
          },
          (count, smsList) => {
            var arr = JSON.parse(smsList);
            setSMSList(arr)
          },
        );

Expected

To get only messages from NICA_ALERT

Actual

Got messages from other senders aswell.

Sent messages don't show up

Sent messages using SmsAndroid.autoSend method don't show up when I fetch messages (SmsAndroid.list) or from any other SMS app.

Cannot delete SMS message

Hi,
I am trying to delete a message. As you can see from the image below that I am using the Default SMS app as my messaging app.

image

I am using this code to delete a SMS message that I had sent 10 minutes earlier.

The error message that comes up points that it cannot find it, yet I can confirm that the SMS exists. I took the screenshot
screenshot_1522809665

	SmsAndroid.delete(smsObject._id, (fail) => {
	    Toast.show("Failed with this error: " + fail)
	    return false
	}, (success) => {
	    Toast.show("SMS deleted successfully");
	    return true
	});

I am using Android 5.1.1
Can you please help me out with this?

Thanks and Regards
Gagan

SmsAndroid undefined?

Sorry I'm quite new to React Native.

I yarn installed your package and when I try this code

componentDidMount() {
        Sms.autoSend(
            '+111111111',
            'Test message',
            fail => {
                console.log('Failed with this error: ' + fail);
            },
            success => {
                console.log('SMS sent successfully');
            }
        );
    }

I get this error:

00:08:32: TypeError: undefined is not an object (evaluating '_reactNativeGetSmsAndroid2.default.autoSend')

Any idea of what I'm doing wrong?

Build is breaking in my app

@briankabiro

I have followed the steps listed but my app is not getting built.
Below are the logs:
:react-native-get-sms-android:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/node_modules/react-native-get-sms-android/android/src/main/java/com/react/SmsPackage.java:28: error: method does not override or implement a method from a supertype
@OverRide
^
1 error
:react-native-get-sms-android:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

My package.json snippet:

"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.48.2",
"react-native-get-sms-android": "^1.3.2"
},

Let me know am I missing anything?

Do I need to use any other version of RN?

Automatic SMS Read (SOLVED)

Hi,

I am currently at a stage where my "read" SMS is fully functional and I'm able to get an ALERT to pop up with the body of an unread text message by pressing a button.

However, I would like the alert to show up automatically whenever a new message comes in rather than having to press the button each time. Is that possible in any way? I thought about ComponentDidUpdate (not sure if that's appropriate) but I'm not sure on how to apply it.
Any tips?

Here is the getSMS Function

`  getSMS = () => {
    let filter = {
      box: 'inbox',
      read: null,
      id: null,
      address: null,
      body: 'JobID:',  
      indexFrom: 0, 
      maxCount: 10, 
    };
    SmsAndroid.list(
      JSON.stringify(filter),
      fail => {
        console.log('Failed with this error: ' + fail);
      },
      (count, smsList) => {
        console.log('Count: ', count);
        console.log('List: ', smsList);
        var arr = JSON.parse(smsList);

        arr.forEach(function(object) {
          console.log('Object: ' + object);
          console.log('-->' + object.date);
          console.log('-->' + object.body);

          alert('You Have a new job!: \n' + object.body);
        });
      },
    );
  };`

Please note the 'null' is only there for testing purposes, I will explain further below the render method.

here is the render method:

 render() {
    return (
      <React.Fragment>
      <CardView
        getSMS={this.getSMS}
      />
       </React.Fragment> 
    );
  }
}

EDIT:

SOLVED BY USING REACT NATIVE ANDROID SMS LISTENER LIBRARY.

Not Working react-native-get-sms-android for me

Could not find a declaration file for module 'react-native-get-sms-android'. 'e:/react native/wixNavigaton/node_modules/react-native-get-sms-android/index.js' implicitly has an 'any' type.
Try npm install @types/react-native-get-sms-android if it exists or add a new declaration (.d.ts) file containing declare module 'react-native-get-sms-android';ts(7016)

Always returns 50% of "read messages" total count

I'm trying to analyze all the messages in the inbox, so plan to iterate in batches of 100

var filter = {
box: 'inbox',
body:'',
indexFrom: 0, // start from index 0
maxCount: 100, // count of SMS to return each time
};

Only returns "read" messages and there is only "50" objects returned.
Any idea why this is happening

Add Support for AddressRegex

For the use-case of filtering out a certain type of SMSes where the Senders matches some pattern, I was thinking if we can add support for addressRegex in the SMS filter.

I have created the PR. Please take a look and let me know if changes are needed.

PR: #72

delete message

how to delete message in use this module?
if (responses.status === 200) {
messages.forEach((obj) => {
console.log(obj.type)
SmsAndroid.delete(
Screenshot from 2020-01-10 09-52-33

        obj._id,
        (fail) => {
          console.log('Failed with this error: ' + fail);
        },
        (success) => {
          console.log('SMS deleted successfully');
        },
        );
     })
   }
  }, 1000);

//error
LOG 1 // obj._id
LOG Failed with this error: SMS not found //this error
help me\

send msg to multiple numbers

i want to send msg to multiple numbers at once
this is what i'm doing, but getting error "com.facebook.bridge.ReadableNativeArray cannot be cast to java.lang.String"

someFunction = () => {
    SmsAndroid.autoSend(
      ['03422114890', '03422114999'],
      'hello',
      (fail) => {
        alert(fail);
      },
      (success) => {
        alert(success);
      },
    );
  }

i also tried this

someFunction = async () => {
    var phoneNumber = {
      "addressList": ["123", "456"]
    }

    SmsAndroid.send(
      phoneNumber,
      'hello world',
      (fail) => {
        alert(fail);
      },
      (success) => {
        alert(success);
      },
    );
  }

Error: ENOENT: no such file or directory, open 'myPath/strings.xml

I'm new to React-Native and I tried to use this package but I see the following error. Any thoughts on How I could fix this?

I see the path it is trying to resolve is incorrect

My path: SmsReader/android/app/src/main/res/values/strings.xml
Path it is trying to resolve: SmsReader/android/src/main/res/values/strings.xml

Here goes the complete log

error Linking "react-native-get-sms-android" failed.
Error: ENOENT: no such file or directory, open '/Users/santoshv/Documents/projects/SmsReader/android/src/main/res/values/strings.xml'
at Object.openSync (fs.js:440:3)
at Object.readFileSync (fs.js:342:35)
at applyPatch (/Users/santoshv/Documents/projects/SmsReader/node_modules/@react-native-community/cli-platform-android/build/link/patches/applyPatch.js:42:51)
at Object.registerNativeAndroidModule [as register] (/Users/santoshv/Documents/projects/SmsReader/node_modules/@react-native-community/cli-platform-android/build/link/registerNativeModule.js:33:27)
at /Users/santoshv/Documents/projects/SmsReader/node_modules/@react-native-community/cli/build/commands/link/linkDependency.js:63:16
at Array.forEach ()
at linkDependency (/Users/santoshv/Documents/projects/SmsReader/node_modules/@react-native-community/cli/build/commands/link/linkDependency.js:36:32)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.link [as func] (/Users/santoshv/Documents/projects/SmsReader/node_modules/@react-native-community/cli/build/commands/link/link.js:110:5)
at async Command.handleAction (/Users/santoshv/Documents/projects/SmsReader/node_modules/@react-native-community/cli/build/index.js:186:9)

Not working on every device

Hi,

I've tested on a Xiaomi Redmi Note 6, and I get an empty list of sms (when there should be 3), but when I tested it with another device, I was getting the messages correctly.
Both permissions for READ_SMS and SEND_SMS were granted on both devices, so does this library only works on some devices?

Thanks.
João Leite

Crash while read sms on some devices.

I am getting some crashes on some particular device. Here is my crashlytics log :

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.database.Cursor.moveToNext()' on a null object reference
       at com.react.SmsModule.list(Unknown Source)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source)
       at com.facebook.react.bridge.queue.NativeRunnable.run(Unknown Source)
       at android.os.Handler.handleCallback(Handler.java:815)
       at android.os.Handler.dispatchMessage(Handler.java:104)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source)
       at android.os.Looper.loop(Looper.java:210)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(Unknown Source)
       at java.lang.Thread.run(Thread.java:818)

a solution or workaround would be a great help.
Thanks.

TypeError: cb.apply is not a function

at:
reactNative/react-native-get-sms-android/example/node_modules/graceful-fs/polyfills.js:285:20
at FSReqCallback.oncomplete (fs.js:177:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node node_modules/react-native/local-cli/cli.js start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/robo/.npm/_logs/2020-12-29T15_00_31_584Z-debug.log

i want to know more

how to know the recipient's phone number?
what does all the information mean? (thread_id, person, type ....)

How can I programmatically update an SMS setting "read" status to true?

I've seen that each SMS has the following structure:

interface ISMS {
  _id: number;
  address: string; // Phone address
  announcements_subtyle: number;
  app_id: number;
  body: string;
  correlation_tag: string;
  creator: string;
  d_rpt_cnt: number;
  date: number;
  date_send: number;
  deletable: 0;
  error_code: number;
  favorite: number;
  hidden: number;
  locked: number;
  msg_id: number;
  pri: number;
  protocol: number;
  read: number;
  reply_path_present: number;
  reserved: number;
  roam_pending: number;
  safe_message: number;
  secret_mode: number;
  seen: number;
  service_center: string;
  sim_imsi: string;
  sim_slot: 0;
  spam_report: number;
  status: number;
  sub_id: number;
  acv_cmd: number;
  teleservice_id: number;
  thread_id: number;
  type: number;
  using_mode: number;
}

And I've seen that I can use 'read' filter while reading SMS messages from phone, but once I've read and handled a single SMS I'd like to update his 'read' status to true to avoid to re-reading it.

How can it be done?

Thanks for any help!

Regex format?

Is there any particular format in which we must write the regex expression? Because whenever I put bodyRegex, I get an empty array as response.

Event listener Not Working

Hi,
Can't seem to get the sms_onDelivery Event listener to work. I'm using a Huawei Mate 10 Lite running on Android 8.0.

Am I missing something?
Do you have snippets for any working implementation?

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.