npm package: @gabpereira21/capacitor-sms-retriever
Description: this plugin get the otp code sent via SMS
Author: me
Latest version: 0.1.10

# capacitor-sms-retriever

soon

## Install

```bash
npm install capacitor-sms-retriever
npx cap sync
```

## API

<docgen-index>

* [`echo(...)`](#echo)
* [`startSMSListener()`](#startsmslistener)
* [`stopSMSListener()`](#stopsmslistener)
* [`onSMSReceived()`](#onsmsreceived)
* [`getAppSignature()`](#getappsignature)
* [`addListener('smsReceived', ...)`](#addlistenersmsreceived-)
* [`removeAllListeners()`](#removealllisteners)
* [Interfaces](#interfaces)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### echo(...)

```typescript
echo(options: { value: string; }) => Promise<{ value: string; }>
```

Test method to verify plugin is working

| Param         | Type                            | Description                           |
| ------------- | ------------------------------- | ------------------------------------- |
| **`options`** | <code>{ value: string; }</code> | - Object containing the value to echo |

**Returns:** <code>Promise&lt;{ value: string; }&gt;</code>

--------------------


### startSMSListener()

```typescript
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()

```typescript
stopSMSListener() => Promise<void>
```

Stop the SMS Retriever listener and clean up resources

--------------------


### onSMSReceived()

```typescript
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:** <code>Promise&lt;{ message: string; }&gt;</code>

--------------------


### getAppSignature()

```typescript
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:** <code>Promise&lt;{ signature: string; }&gt;</code>

--------------------


### addListener('smsReceived', ...)

```typescript
addListener(eventName: 'smsReceived', listenerFunc: (data: { message: string; }) => void) => Promise<PluginListenerHandle>
```

Add a listener for SMS received events

| Param              | Type                                                 | Description                              |
| ------------------ | ---------------------------------------------------- | ---------------------------------------- |
| **`eventName`**    | <code>'smsReceived'</code>                           | - The event name ('smsReceived')         |
| **`listenerFunc`** | <code>(data: { message: string; }) =&gt; void</code> | - Callback function when SMS is received |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

--------------------


### removeAllListeners()

```typescript
removeAllListeners() => Promise<void>
```

Remove all listeners for this plugin

--------------------


### Interfaces


#### PluginListenerHandle

| Prop         | Type                                      |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |

</docgen-api>