GithubHelp home page GithubHelp logo

cartona / capacitor-sms-retriever Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cardihab/capacitor-sms-retriever

0.0 0.0 0.0 2.47 MB

Android SMS Retriever API for Capacitor.

License: MIT License

JavaScript 2.09% Ruby 4.23% Objective-C 3.96% Java 70.48% TypeScript 12.82% Swift 6.41%

capacitor-sms-retriever's Introduction

capacitor-sms-retriever

With the SMS Retriever API, you can perform SMS-based user verification in your Android app automatically, without requiring the user to manually type verification codes, and without requiring any extra app permissions.



Install

npm install capacitor-sms-retriever
npx cap sync

API

getAppSignature()

getAppSignature() => Promise<AppSignature>

This is a helper method to generate your message hash to be included in your SMS message. Without the correct hash, your app won't receive the message callback. This only needs to be generated once per app and stored.

Note: Do not use hash strings dynamically computed on the client in your verification messages.

Returns: Promise<AppSignature>

Since: 0.1.0


requestPhoneNumber()

requestPhoneNumber() => Promise<HintPhoneNumber>

Initiate hint picker to prompt the user to choose from the phone numbers stored on the device.

Returns: Promise<HintPhoneNumber>

Since: 0.1.0


startSmsReceiver()

startSmsReceiver() => Promise<RegisterReceiver>

Start to listen for SMS messages.

Returns: Promise<RegisterReceiver>

Since: 0.1.0


removeSmsReceiver()

removeSmsReceiver() => Promise<void>

Stop to listen for SMS messages.

Since: 0.1.0


addListener('onSmsReceive', ...)

addListener(eventName: 'onSmsReceive', listenerFunc: (receivedMessage: ReceivedMessage) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for when SMS is coming

Param Type
eventName 'onSmsReceive'
listenerFunc (receivedMessage: ReceivedMessage) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.1.0


Interfaces

AppSignature

Prop Type Description Since
signature string App signature. 0.1.0

HintPhoneNumber

Prop Type Description Since
phoneNumber string Phone number user selected 0.1.0

RegisterReceiver

Prop Type Description Since
isRegistered boolean Returns if register receiver started or not. 0.1.0

PluginListenerHandle

Prop Type
remove () => Promise<void>

ReceivedMessage

Prop Type Description Since
message string Received message with hash 0.1.0
error string In case of any error 0.1.0

capacitor-sms-retriever's People

Contributors

dwlrathod 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.