Plugin for iOS Critical Alerts
npm install critical-alertsPlugin for Critical Alerts in IOS & ANDROID
``bash`
npm install critical-alerts
npx cap sync
* echo(...)
* requestPermission()
* checkPermission()
* openAppSettings()
* checkDndAccess()
* openDndSettings()
* createChannel(...)
* deleteAllChannel()
* Interfaces
* Type Aliases
`typescript`
echo(options: { value: string; }) => Promise<{ value: string; }>
| Param | Type |
| ------------- | ------------------------------- |
| options | { value: string; } |
Returns: Promise<{ value: string; }>
--------------------
`typescript`
requestPermission() => Promise<{ granted: boolean; }>
Returns: Promise<{ granted: boolean; }>
--------------------
`typescript`
checkPermission() => Promise<{ authorized: boolean; criticalAlert: boolean; }>
Returns: Promise<{ authorized: boolean; criticalAlert: boolean; }>
--------------------
`typescript`
openAppSettings() => Promise<{ granted: boolean; }>
Returns: Promise<{ granted: boolean; }>
--------------------
`typescript`
checkDndAccess() => Promise<{ granted: boolean; }>
Returns: Promise<{ granted: boolean; }>
--------------------
`typescript`
openDndSettings() => Promise<{ granted: boolean; }>
Returns: Promise<{ granted: boolean; }>
--------------------
`typescript`
createChannel(channel: Channel) => Promise
| Param | Type |
| ------------- | ------------------------------------------- |
| channel | Channel |
--------------------
`typescript`
deleteAllChannel() => Promise
--------------------
#### Channel
| Prop | Type | Description | Default | Since |
| ----------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----- |
| id | string | The channel identifier. | | 1.0.0 |
| name | string | The human-friendly name of this channel (presented to the user). | | 1.0.0 |
| description | string | The description of this channel (presented to the user). | | 1.0.0 |
| sound | string | The sound that should be played for notifications posted to this channel. Notification channels with an importance of at least 3 should have a sound. The file name of a sound file should be specified relative to the android app res/raw directory. | | 1.0.0 |importance
| | visibilityImportance | The level of interruption for notifications posted to this channel. | 3 | 1.0.0 |
| | lightsVisibility | The visibility of notifications posted to this channel. This setting is for whether notifications posted to this channel appear on the lockscreen or not, and if so, whether they appear in a redacted form. | | 1.0.0 |
| | lightColorboolean | Whether notifications posted to this channel should display notification lights, on devices that support it. | | 1.0.0 |
| | #RRGGBBstring | The light color for notifications posted to this channel. Only supported if lights are enabled on this channel and the device supports it. Supported color formats are and #RRGGBBAA. | | 1.0.0 |vibration
| | bypassDnd` | boolean | Whether notifications posted to this channel should vibrate. | | 1.0.0 |
| boolean | Whether notifications posted in dnd or doze mode . | | 1.0.0 |
#### Importance
1 | 2 | 3 | 4 | 5
#### Visibility
-1 | 0 | 1