1.0.1 • Published 6 months ago

capacitor-sms-inbox-fork v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

capacitor-sms-inbox

A capacitor plugin to read SMS inbox

Install

npm install capacitor-sms-inbox
npx cap sync android

API

checkPermissions()

checkPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


requestPermissions()

requestPermissions() => Promise<PermissionStatus>

Returns: Promise<PermissionStatus>


getCount(...)

getCount(options: { filter?: SMSFilter; }) => Promise<{ count: number; }>
ParamType
options{ filter?: SMSFilter; }

Returns: Promise<{ count: number; }>


getSMSList(...)

getSMSList(options: { projection?: Projection; filter?: SMSFilter; }) => Promise<{ smsList: SMSObject[]; }>
ParamType
options{ projection?: Projection; filter?: SMSFilter; }

Returns: Promise<{ smsList: SMSObject[]; }>


getRawSMSList(...)

getRawSMSList(options: { filter?: SMSFilter; }) => Promise<{ rawSmsList: any; }>

Returns a raw sms object (all columns). Its like running SELECT * FROM ..

E.g.

{
  "_id": 33,
  "thread_id": 153,
  "address": "TEST",
  "person": null,
  "date": 1679232404564,
  "date_sent": 1679562604444,
  "protocol": 0,
  "read": 0,
  "status": -1,
  "type": 1,
  "reply_path_present": 0,
  "subject": null,
  "body": "SMS body",
  "service_center": "+918299901123",
  "locked": 0,
  "sub_id": 1,
  "error_code": 0,
  "creator": "com.google.android.apps.messaging",
  "seen": 1,
  "priority": -1
}

Note: This is a raw query and ineffecient. Use with caution

ParamType
options{ filter?: SMSFilter; }

Returns: Promise<{ rawSmsList: any; }>


Interfaces

PermissionStatus

PropType
smsPermissionState

SMSFilter

PropTypeDefault
typeMessageTypeMessageType.INBOX
idnumber
threadIdnumber
bodystring
bodyRegexstring
addressstring
addressRegexstring
minDatenumber
maxDatenumber
indexFromnumber
maxCountnumber

SMSObject

PropType
idnumber
threadIdnumber
typeMessageType
addressstring
creatorstring
personstring
datenumber
dateSentnumber
subjectstring
bodystring

Projection

PropTypeDefault
idbooleantrue
threadIdbooleantrue
typebooleantrue
addressbooleantrue
creatorbooleanfalse
personbooleanfalse
datebooleantrue
dateSentbooleanfalse
subjectbooleantrue
bodybooleantrue

Type Aliases

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

Enums

MessageType

MembersValue
ALL0
INBOX1
SENT2
DRAFT3
OUTBOX4
FAILED5
QUEUED6
1.0.1

6 months ago