Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
RaddishIoW committed Apr 4, 2023
2 parents 4d11245 + cd785f9 commit 418ee39
Show file tree
Hide file tree
Showing 4 changed files with 891 additions and 75 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# [1.0.0-alpha.2](https://github.com/HaylLtd/capacitor-push-notifications/compare/1.0.0-alpha.1...v1.0.0-alpha.2) (2023-04-04)


### Bug Fixes

* add missing service declaration in the manifest ([4d11245](https://github.com/HaylLtd/capacitor-push-notifications/commit/4d11245525e3d60647001584c7106f988bb85822))


### Reverts

* Revert "chore: add lockfile to gitignore" ([f8744e4](https://github.com/HaylLtd/capacitor-push-notifications/commit/f8744e47ac8f0afe86d87d7b872c6d978bf29bfc))

# [1.0.0-alpha.1](https://github.com/HaylLtd/capacitor-push-notifications) (2023-03-30)

* Initial Release
134 changes: 60 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ You can configure the way the push notifications are displayed when the app is i

| Prop | Type | Description | Since |
| ----------------------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| **`presentationOptions`** | <code>PresentationOption[]</code> | This is an array of strings you can combine. Possible values in the array are: - `badge`: badge count on the app icon is updated (default value) - `sound`: the device will ring/vibrate when the push notification is received - `alert`: the push notification is displayed in a native dialog An empty array can be provided if none of the options are desired. badge is only available for iOS. | 1.0.0 |
| **`presentationOptions`** | <code>{}</code> | This is an array of strings you can combine. Possible values in the array are: - `badge`: badge count on the app icon is updated (default value) - `sound`: the device will ring/vibrate when the push notification is received - `alert`: the push notification is displayed in a native dialog An empty array can be provided if none of the options are desired. badge is only available for iOS. | 1.0.0 |
| **`androidForegroundChannelId`** | <code>AndroidForegroundChannelOption</code> | The channel for android foreground notifications. - 'default': Use the default channel for foreground notifications. - 'auto': Use the channel specified in the notification for foreground notifications. - string: Use the specified channel for foreground notifications. You must create the channel manually. | 1.0.0 |
| **`androidForegroundChannelName`** | <code>string</code> | The name of the channel for android background notifications if using 'default' for androidForegroundChannelId. | 1.0.0 |
| **`androidForegroundChannelDescription`** | <code>string</code> | The description of the channel for android background notifications if using 'default' for androidForegroundChannelId. | 1.0.0 |
Expand Down Expand Up @@ -171,48 +171,22 @@ const getDeliveredNotifications = async () => {

<docgen-index>

- [Capacitor Push Notifications](#capacitor-push-notifications)
- [Install](#install)
- [iOS](#ios)
- [Android](#android)
- [Variables](#variables)
- [Push Notifications icon](#push-notifications-icon)
- [Push notifications appearance in foreground](#push-notifications-appearance-in-foreground)
- [Examples](#examples)
- [Silent Push Notifications / Data-only Notifications](#silent-push-notifications--data-only-notifications)
- [iOS](#ios-1)
- [Android](#android-1)
- [Common Issues](#common-issues)
- [Example](#example)
- [API](#api)
- [register()](#register)
- [getDeliveredNotifications()](#getdeliverednotifications)
- [removeDeliveredNotifications(...)](#removedeliverednotifications)
- [removeAllDeliveredNotifications()](#removealldeliverednotifications)
- [createChannel(...)](#createchannel)
- [deleteChannel(...)](#deletechannel)
- [listChannels()](#listchannels)
- [checkPermissions()](#checkpermissions)
- [requestPermissions()](#requestpermissions)
- [addListener('registration', ...)](#addlistenerregistration-)
- [addListener('registrationError', ...)](#addlistenerregistrationerror-)
- [addListener('pushNotificationReceived', ...)](#addlistenerpushnotificationreceived-)
- [addListener('pushNotificationActionPerformed', ...)](#addlistenerpushnotificationactionperformed-)
- [removeAllListeners()](#removealllisteners)
- [Interfaces](#interfaces)
- [DeliveredNotifications](#deliverednotifications)
- [PushNotificationSchema](#pushnotificationschema)
- [Channel](#channel)
- [ListChannelsResult](#listchannelsresult)
- [PermissionStatus](#permissionstatus)
- [PluginListenerHandle](#pluginlistenerhandle)
- [Token](#token)
- [RegistrationError](#registrationerror)
- [ActionPerformed](#actionperformed)
- [Type Aliases](#type-aliases)
- [Importance](#importance)
- [Visibility](#visibility)
- [PermissionState](#permissionstate)
* [`register()`](#register)
* [`getDeliveredNotifications()`](#getdeliverednotifications)
* [`removeDeliveredNotifications(...)`](#removedeliverednotifications)
* [`removeAllDeliveredNotifications()`](#removealldeliverednotifications)
* [`createChannel(...)`](#createchannel)
* [`deleteChannel(...)`](#deletechannel)
* [`listChannels()`](#listchannels)
* [`checkPermissions()`](#checkpermissions)
* [`requestPermissions()`](#requestpermissions)
* [`addListener('registration', ...)`](#addlistenerregistration)
* [`addListener('registrationError', ...)`](#addlistenerregistrationerror)
* [`addListener('pushNotificationReceived', ...)`](#addlistenerpushnotificationreceived)
* [`addListener('pushNotificationActionPerformed', ...)`](#addlistenerpushnotificationactionperformed)
* [`removeAllListeners()`](#removealllisteners)
* [Interfaces](#interfaces)
* [Type Aliases](#type-aliases)

</docgen-index>

Expand All @@ -222,7 +196,7 @@ const getDeliveredNotifications = async () => {
### register()

```typescript
register() => Promise<void>
register() => any
```

Register the app to receive push notifications.
Expand All @@ -231,6 +205,8 @@ This method will trigger the `'registration'` event with the push token or
`'registrationError'` if there was a problem. It does not prompt the user for
notification permissions, use `requestPermissions()` first.

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

**Since:** 1.0.0

--------------------
Expand All @@ -239,12 +215,12 @@ notification permissions, use `requestPermissions()` first.
### getDeliveredNotifications()

```typescript
getDeliveredNotifications() => Promise<DeliveredNotifications>
getDeliveredNotifications() => any
```

Get a list of notifications that are visible on the notifications screen.

**Returns:** <code>Promise&lt;<a href="#deliverednotifications">DeliveredNotifications</a>&gt;</code>
**Returns:** <code>any</code>

**Since:** 1.0.0

Expand All @@ -254,7 +230,7 @@ Get a list of notifications that are visible on the notifications screen.
### removeDeliveredNotifications(...)

```typescript
removeDeliveredNotifications(delivered: DeliveredNotifications) => Promise<void>
removeDeliveredNotifications(delivered: DeliveredNotifications) => any
```

Remove the specified notifications from the notifications screen.
Expand All @@ -263,6 +239,8 @@ Remove the specified notifications from the notifications screen.
| --------------- | ------------------------------------------------------------------------- |
| **`delivered`** | <code><a href="#deliverednotifications">DeliveredNotifications</a></code> |

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

**Since:** 1.0.0

--------------------
Expand All @@ -271,11 +249,13 @@ Remove the specified notifications from the notifications screen.
### removeAllDeliveredNotifications()

```typescript
removeAllDeliveredNotifications() => Promise<void>
removeAllDeliveredNotifications() => any
```

Remove all the notifications from the notifications screen.

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

**Since:** 1.0.0

--------------------
Expand All @@ -284,7 +264,7 @@ Remove all the notifications from the notifications screen.
### createChannel(...)

```typescript
createChannel(channel: Channel) => Promise<void>
createChannel(channel: Channel) => any
```

Create a notification channel.
Expand All @@ -295,6 +275,8 @@ Only available on Android O or newer (SDK 26+).
| ------------- | ------------------------------------------- |
| **`channel`** | <code><a href="#channel">Channel</a></code> |

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

**Since:** 1.0.0

--------------------
Expand All @@ -303,7 +285,7 @@ Only available on Android O or newer (SDK 26+).
### deleteChannel(...)

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

Delete a notification channel.
Expand All @@ -314,6 +296,8 @@ Only available on Android O or newer (SDK 26+).
| ---------- | ---------------------------- |
| **`args`** | <code>{ id: string; }</code> |

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

**Since:** 1.0.0

--------------------
Expand All @@ -322,14 +306,14 @@ Only available on Android O or newer (SDK 26+).
### listChannels()

```typescript
listChannels() => Promise<ListChannelsResult>
listChannels() => any
```

List the available notification channels.

Only available on Android O or newer (SDK 26+).

**Returns:** <code>Promise&lt;<a href="#listchannelsresult">ListChannelsResult</a>&gt;</code>
**Returns:** <code>any</code>

**Since:** 1.0.0

Expand All @@ -339,7 +323,7 @@ Only available on Android O or newer (SDK 26+).
### checkPermissions()

```typescript
checkPermissions() => Promise<PermissionStatus>
checkPermissions() => any
```

Check permission to receive push notifications.
Expand All @@ -348,7 +332,7 @@ On Android the status is always granted because you can always
receive push notifications. If you need to check if the user allows
to display notifications, use local-notifications plugin.

**Returns:** <code>Promise&lt;<a href="#permissionstatus">PermissionStatus</a>&gt;</code>
**Returns:** <code>any</code>

**Since:** 1.0.0

Expand All @@ -358,7 +342,7 @@ to display notifications, use local-notifications plugin.
### requestPermissions()

```typescript
requestPermissions() => Promise<PermissionStatus>
requestPermissions() => any
```

Request permission to receive push notifications.
Expand All @@ -371,7 +355,7 @@ for push notification permission and return granted or denied based
on the user selection. On following calls it will get the current status of
the permission without prompting again.

**Returns:** <code>Promise&lt;<a href="#permissionstatus">PermissionStatus</a>&gt;</code>
**Returns:** <code>any</code>

**Since:** 1.0.0

Expand All @@ -393,7 +377,7 @@ Provides the push notification token.
| **`eventName`** | <code>'registration'</code> |
| **`listenerFunc`** | <code>(token: <a href="#token">Token</a>) =&gt; void</code> |

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

**Since:** 1.0.0

Expand All @@ -415,7 +399,7 @@ Provides an error with the registration problem.
| **`eventName`** | <code>'registrationError'</code> |
| **`listenerFunc`** | <code>(error: <a href="#registrationerror">RegistrationError</a>) =&gt; void</code> |

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

**Since:** 1.0.0

Expand All @@ -435,7 +419,7 @@ Called when the device receives a push notification.
| **`eventName`** | <code>'pushNotificationReceived'</code> |
| **`listenerFunc`** | <code>(notification: <a href="#pushnotificationschema">PushNotificationSchema</a>) =&gt; void</code> |

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

**Since:** 1.0.0

Expand All @@ -455,7 +439,7 @@ Called when an action is performed on a push notification.
| **`eventName`** | <code>'pushNotificationActionPerformed'</code> |
| **`listenerFunc`** | <code>(notification: <a href="#actionperformed">ActionPerformed</a>) =&gt; void</code> |

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

**Since:** 1.0.0

Expand All @@ -465,11 +449,13 @@ Called when an action is performed on a push notification.
### removeAllListeners()

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

Remove all native listeners for this plugin.

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

**Since:** 1.0.0

--------------------
Expand All @@ -480,9 +466,9 @@ Remove all native listeners for this plugin.

#### DeliveredNotifications

| Prop | Type | Description | Since |
| ------------------- | ------------------------------------- | ------------------------------------------------------------------- | ----- |
| **`notifications`** | <code>PushNotificationSchema[]</code> | List of notifications that are visible on the notifications screen. | 1.0.0 |
| Prop | Type | Description | Since |
| ------------------- | --------------- | ------------------------------------------------------------------- | ----- |
| **`notifications`** | <code>{}</code> | List of notifications that are visible on the notifications screen. | 1.0.0 |


#### PushNotificationSchema
Expand Down Expand Up @@ -519,9 +505,9 @@ Remove all native listeners for this plugin.

#### ListChannelsResult

| Prop | Type | Description | Since |
| -------------- | ---------------------- | --------------------------------------------- | ----- |
| **`channels`** | <code>Channel[]</code> | List of all the Channels created by your app. | 1.0.0 |
| Prop | Type | Description | Since |
| -------------- | --------------- | --------------------------------------------- | ----- |
| **`channels`** | <code>{}</code> | List of all the Channels created by your app. | 1.0.0 |


#### PermissionStatus
Expand All @@ -531,20 +517,20 @@ Remove all native listeners for this plugin.
| **`receive`** | <code><a href="#permissionstate">PermissionState</a></code> | Permission state of receiving notifications. | 1.0.0 |


#### PluginListenerHandle

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


#### Token

| Prop | Type | Description | Since |
| ----------- | ------------------- | ------------------------------------------------------------------------ | ----- |
| **`value`** | <code>string</code> | On iOS it contains the APNS token. On Android it contains the FCM token. | 1.0.0 |


#### PluginListenerHandle

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


#### RegistrationError

| Prop | Type | Description | Since |
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@haylltd/capacitor-push-notifications",
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"description": "Improved push notification support for Capacitor apps",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -38,6 +38,7 @@
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
"swiftlint": "node-swiftlint",
"docgen": "docgen --api PushNotificationsPlugin --output-readme README.md --output-json dist/docs.json",
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
"clean": "rimraf ./dist",
"watch": "tsc --watch",
Expand All @@ -52,6 +53,7 @@
"@ionic/eslint-config": "^0.3.0",
"@ionic/prettier-config": "^1.0.1",
"@ionic/swiftlint-config": "^1.1.2",
"conventional-changelog-cli": "^2.2.2",
"eslint": "^7.11.0",
"prettier": "~2.3.0",
"prettier-plugin-java": "~1.0.2",
Expand Down
Loading

0 comments on commit 418ee39

Please sign in to comment.