ion-sms-retrieved
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

ion-sms-retrieved

Implement Android SMS retrived

Install

npm install ion-sms-retrieved
npx cap sync

Example

OTP screen

// register to SMS receiver when screen appear
AndroidSmsRetrieved.registerSmsReceiver();
// unregister from SMS receiver when screen dissappear
AndroidSmsRetrieved.unregisterSmsReceiver();
// get otp from sms
AndroidSmsRetrieved.startSmsUserConsent().then(({ otp }) => {
  this.oneTimeCode = otp;
});

API

registerSmsReceiver()

registerSmsReceiver() => any

Returns: any


unregisterSmsReceiver()

unregisterSmsReceiver() => any

Returns: any


startSmsUserConsent()

startSmsUserConsent() => Promise<{ otp: string; }>

Returns: Promise<{ otp: string; }>


Ref

Auto read otp android user consent api
Build capacitor plugin
Custom Native Android Code
Create implementation in plugin

Readme

Keywords

Package Sidebar

Install

npm i ion-sms-retrieved

Weekly Downloads

2

Version

0.0.7

License

MIT

Unpacked Size

19.6 kB

Total Files

24

Last publish

Collaborators

  • anhhtbk