@gabpereira21/capacitor-sms-retriever
v0.1.10
Published
this plugin get the otp code sent via SMS
Readme
capacitor-sms-retriever
soon
Install
npm install capacitor-sms-retriever
npx cap syncAPI
echo(...)startSMSListener()stopSMSListener()onSMSReceived()getAppSignature()addListener('smsReceived', ...)removeAllListeners()- Interfaces
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>Test method to verify plugin is working
| Param | Type | Description |
| ------------- | ------------------------------- | ------------------------------------- |
| options | { value: string; } | - Object containing the value to echo |
Returns: Promise<{ value: string; }>
startSMSListener()
startSMSListener() => Promise<void>Start the SMS Retriever listener This initiates the SMS Retriever API which will listen for incoming SMS messages containing the app's hash for 5 minutes
stopSMSListener()
stopSMSListener() => Promise<void>Stop the SMS Retriever listener and clean up resources
onSMSReceived()
onSMSReceived() => Promise<{ message: string; }>Register a callback to receive SMS messages The callback will be triggered when an SMS is received that matches the app's hash signature
Returns: Promise<{ message: string; }>
getAppSignature()
getAppSignature() => Promise<{ signature: string; }>Get the app's hash string for SMS Retriever This hash should be included at the end of your SMS messages
Returns: Promise<{ signature: string; }>
addListener('smsReceived', ...)
addListener(eventName: 'smsReceived', listenerFunc: (data: { message: string; }) => void) => Promise<PluginListenerHandle>Add a listener for SMS received events
| Param | Type | Description |
| ------------------ | ---------------------------------------------------- | ---------------------------------------- |
| eventName | 'smsReceived' | - The event name ('smsReceived') |
| listenerFunc | (data: { message: string; }) => void | - Callback function when SMS is received |
Returns: Promise<PluginListenerHandle>
removeAllListeners()
removeAllListeners() => Promise<void>Remove all listeners for this plugin
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
