npm package: @kim5257/capacitor-google-notifications
Description: FCM capacitor plugin
Author: kim5257app
Latest version: 0.0.7

# capacitor-google-notifications

FCM capacitor plugin

## Install

```bash
npm install capacitor-google-notifications
npx cap sync
```

## API

<docgen-index>

* [`initialize(...)`](#initialize)
* [`checkPermissions()`](#checkpermissions)
* [`requestPermissions()`](#requestpermissions)
* [`register(...)`](#register)
* [`unregister()`](#unregister)
* [`getDeliveredNotifications()`](#getdeliverednotifications)
* [`removeDeliveredNotifications(...)`](#removedeliverednotifications)
* [`removeAllDeliveredNotifications()`](#removealldeliverednotifications)
* [`createChannel(...)`](#createchannel)
* [`deleteChannel(...)`](#deletechannel)
* [`listChannels()`](#listchannels)
* [`addListener('registration', ...)`](#addlistenerregistration-)
* [`addListener('registrationError', ...)`](#addlistenerregistrationerror-)
* [`addListener('pushNotificationReceived', ...)`](#addlistenerpushnotificationreceived-)
* [`addListener('pushNotificationActionPerformed', ...)`](#addlistenerpushnotificationactionperformed-)
* [`removeAllListeners()`](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

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

### initialize(...)

```typescript
initialize(initOptions: InitializeOptions, options: FCMOptions) => any
```

| Param             | Type                                                            |
| ----------------- | --------------------------------------------------------------- |
| **`initOptions`** | <code><a href="#initializeoptions">InitializeOptions</a></code> |
| **`options`**     | <code><a href="#fcmoptions">FCMOptions</a></code>               |

**Returns:** <code>any</code>

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


### checkPermissions()

```typescript
checkPermissions() => any
```

**Returns:** <code>any</code>

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


### requestPermissions()

```typescript
requestPermissions() => any
```

**Returns:** <code>any</code>

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


### register(...)

```typescript
register(options: { vapidKey: string; }) => any
```

| Param         | Type                               |
| ------------- | ---------------------------------- |
| **`options`** | <code>{ vapidKey: string; }</code> |

**Returns:** <code>any</code>

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


### unregister()

```typescript
unregister() => any
```

**Returns:** <code>any</code>

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


### getDeliveredNotifications()

```typescript
getDeliveredNotifications() => any
```

**Returns:** <code>any</code>

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


### removeDeliveredNotifications(...)

```typescript
removeDeliveredNotifications(delivered: DeliveredNotifications) => any
```

| Param           | Type                                                                      |
| --------------- | ------------------------------------------------------------------------- |
| **`delivered`** | <code><a href="#deliverednotifications">DeliveredNotifications</a></code> |

**Returns:** <code>any</code>

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


### removeAllDeliveredNotifications()

```typescript
removeAllDeliveredNotifications() => any
```

**Returns:** <code>any</code>

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


### createChannel(...)

```typescript
createChannel(channel: Channel) => any
```

| Param         | Type                                        |
| ------------- | ------------------------------------------- |
| **`channel`** | <code><a href="#channel">Channel</a></code> |

**Returns:** <code>any</code>

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


### deleteChannel(...)

```typescript
deleteChannel(args: { id: string; }) => any
```

| Param      | Type                         |
| ---------- | ---------------------------- |
| **`args`** | <code>{ id: string; }</code> |

**Returns:** <code>any</code>

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


### listChannels()

```typescript
listChannels() => any
```

**Returns:** <code>any</code>

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


### addListener('registration', ...)

```typescript
addListener(eventName: 'registration', listenerFunc: (token: Token) => void) => any
```

| Param              | Type                                                        |
| ------------------ | ----------------------------------------------------------- |
| **`eventName`**    | <code>'registration'</code>                                 |
| **`listenerFunc`** | <code>(token: <a href="#token">Token</a>) =&gt; void</code> |

**Returns:** <code>any</code>

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


### addListener('registrationError', ...)

```typescript
addListener(eventName: 'registrationError', listenerFunc: (error: RegistrationError) => void) => any
```

| Param              | Type                                                                                |
| ------------------ | ----------------------------------------------------------------------------------- |
| **`eventName`**    | <code>'registrationError'</code>                                                    |
| **`listenerFunc`** | <code>(error: <a href="#registrationerror">RegistrationError</a>) =&gt; void</code> |

**Returns:** <code>any</code>

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


### addListener('pushNotificationReceived', ...)

```typescript
addListener(eventName: 'pushNotificationReceived', listenerFunc: (notification: PushNotificationSchema) => void) => any
```

| Param              | Type                                                                                                 |
| ------------------ | ---------------------------------------------------------------------------------------------------- |
| **`eventName`**    | <code>'pushNotificationReceived'</code>                                                              |
| **`listenerFunc`** | <code>(notification: <a href="#pushnotificationschema">PushNotificationSchema</a>) =&gt; void</code> |

**Returns:** <code>any</code>

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


### addListener('pushNotificationActionPerformed', ...)

```typescript
addListener(eventName: 'pushNotificationActionPerformed', listenerFunc: (notification: ActionPerformed) => void) => any
```

| Param              | Type                                                                                   |
| ------------------ | -------------------------------------------------------------------------------------- |
| **`eventName`**    | <code>'pushNotificationActionPerformed'</code>                                         |
| **`listenerFunc`** | <code>(notification: <a href="#actionperformed">ActionPerformed</a>) =&gt; void</code> |

**Returns:** <code>any</code>

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


### removeAllListeners()

```typescript
removeAllListeners() => any
```

**Returns:** <code>any</code>

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


### Interfaces


#### InitializeOptions

| Prop               | Type                 |
| ------------------ | -------------------- |
| **`name`**         | <code>string</code>  |
| **`initialize`**   | <code>boolean</code> |
| **`initializeSw`** | <code>boolean</code> |


#### InstanceFactoryOptions

| Prop                     | Type                |
| ------------------------ | ------------------- |
| **`instanceIdentifier`** | <code>string</code> |
| **`options`**            | <code>{}</code>     |


#### FCMOptions

| Prop       | Type                |
| ---------- | ------------------- |
| **`test`** | <code>string</code> |


#### PermissionStatus

| Prop          | Type                                                                     |
| ------------- | ------------------------------------------------------------------------ |
| **`receive`** | <code><a href="#permissionstate">PermissionState</a> \| 'default'</code> |


#### DeliveredNotifications

| Prop                | Type            |
| ------------------- | --------------- |
| **`notifications`** | <code>{}</code> |


#### PushNotificationSchema

| Prop               | Type                 |
| ------------------ | -------------------- |
| **`title`**        | <code>string</code>  |
| **`subtitle`**     | <code>string</code>  |
| **`body`**         | <code>string</code>  |
| **`id`**           | <code>string</code>  |
| **`tag`**          | <code>string</code>  |
| **`badge`**        | <code>string</code>  |
| **`notification`** | <code>any</code>     |
| **`data`**         | <code>any</code>     |
| **`clickAction`**  | <code>string</code>  |
| **`link`**         | <code>string</code>  |
| **`group`**        | <code>string</code>  |
| **`groupSummary`** | <code>boolean</code> |


#### Channel

| Prop              | Type                                              |
| ----------------- | ------------------------------------------------- |
| **`id`**          | <code>string</code>                               |
| **`name`**        | <code>string</code>                               |
| **`description`** | <code>string</code>                               |
| **`sound`**       | <code>string</code>                               |
| **`importance`**  | <code><a href="#importance">Importance</a></code> |
| **`visibility`**  | <code><a href="#visibility">Visibility</a></code> |
| **`lights`**      | <code>boolean</code>                              |
| **`lightColor`**  | <code>string</code>                               |
| **`vibration`**   | <code>boolean</code>                              |


#### ListChannelsResult

| Prop           | Type            |
| -------------- | --------------- |
| **`channels`** | <code>{}</code> |


#### Token

| Prop        | Type                |
| ----------- | ------------------- |
| **`value`** | <code>string</code> |


#### PluginListenerHandle

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


#### RegistrationError

| Prop        | Type                |
| ----------- | ------------------- |
| **`error`** | <code>string</code> |


#### ActionPerformed

| Prop               | Type                                                                      |
| ------------------ | ------------------------------------------------------------------------- |
| **`actionId`**     | <code>string</code>                                                       |
| **`inputValue`**   | <code>string</code>                                                       |
| **`notification`** | <code><a href="#pushnotificationschema">PushNotificationSchema</a></code> |


### Type Aliases


#### InitializeOptions

<code><a href="#instancefactoryoptions">InstanceFactoryOptions</a></code>


#### PermissionState

<code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>


#### Importance

<code>1 | 2 | 3 | 4 | 5</code>


#### Visibility

<code>-1 | 0 | 1</code>

</docgen-api>