@kim5257/capacitor-google-notifications
v0.0.7
Published
FCM capacitor plugin
Downloads
7
Readme
capacitor-google-notifications
FCM capacitor plugin
Install
npm install capacitor-google-notifications
npx cap sync
API
initialize(...)
checkPermissions()
requestPermissions()
register(...)
unregister()
getDeliveredNotifications()
removeDeliveredNotifications(...)
removeAllDeliveredNotifications()
createChannel(...)
deleteChannel(...)
listChannels()
addListener('registration', ...)
addListener('registrationError', ...)
addListener('pushNotificationReceived', ...)
addListener('pushNotificationActionPerformed', ...)
removeAllListeners()
- Interfaces
- Type Aliases
initialize(...)
initialize(initOptions: InitializeOptions, options: FCMOptions) => any
| Param | Type |
| ----------------- | --------------------------------------------------------------- |
| initOptions
| InitializeOptions |
| options
| FCMOptions |
Returns: any
checkPermissions()
checkPermissions() => any
Returns: any
requestPermissions()
requestPermissions() => any
Returns: any
register(...)
register(options: { vapidKey: string; }) => any
| Param | Type |
| ------------- | ---------------------------------- |
| options
| { vapidKey: string; } |
Returns: any
unregister()
unregister() => any
Returns: any
getDeliveredNotifications()
getDeliveredNotifications() => any
Returns: any
removeDeliveredNotifications(...)
removeDeliveredNotifications(delivered: DeliveredNotifications) => any
| Param | Type |
| --------------- | ------------------------------------------------------------------------- |
| delivered
| DeliveredNotifications |
Returns: any
removeAllDeliveredNotifications()
removeAllDeliveredNotifications() => any
Returns: any
createChannel(...)
createChannel(channel: Channel) => any
| Param | Type |
| ------------- | ------------------------------------------- |
| channel
| Channel |
Returns: any
deleteChannel(...)
deleteChannel(args: { id: string; }) => any
| Param | Type |
| ---------- | ---------------------------- |
| args
| { id: string; } |
Returns: any
listChannels()
listChannels() => any
Returns: any
addListener('registration', ...)
addListener(eventName: 'registration', listenerFunc: (token: Token) => void) => any
| Param | Type |
| ------------------ | ----------------------------------------------------------- |
| eventName
| 'registration' |
| listenerFunc
| (token: Token) => void |
Returns: any
addListener('registrationError', ...)
addListener(eventName: 'registrationError', listenerFunc: (error: RegistrationError) => void) => any
| Param | Type |
| ------------------ | ----------------------------------------------------------------------------------- |
| eventName
| 'registrationError' |
| listenerFunc
| (error: RegistrationError) => void |
Returns: any
addListener('pushNotificationReceived', ...)
addListener(eventName: 'pushNotificationReceived', listenerFunc: (notification: PushNotificationSchema) => void) => any
| Param | Type |
| ------------------ | ---------------------------------------------------------------------------------------------------- |
| eventName
| 'pushNotificationReceived' |
| listenerFunc
| (notification: PushNotificationSchema) => void |
Returns: any
addListener('pushNotificationActionPerformed', ...)
addListener(eventName: 'pushNotificationActionPerformed', listenerFunc: (notification: ActionPerformed) => void) => any
| Param | Type |
| ------------------ | -------------------------------------------------------------------------------------- |
| eventName
| 'pushNotificationActionPerformed' |
| listenerFunc
| (notification: ActionPerformed) => void |
Returns: any
removeAllListeners()
removeAllListeners() => any
Returns: any
Interfaces
InitializeOptions
| Prop | Type |
| ------------------ | -------------------- |
| name
| string |
| initialize
| boolean |
| initializeSw
| boolean |
InstanceFactoryOptions
| Prop | Type |
| ------------------------ | ------------------- |
| instanceIdentifier
| string |
| options
| {} |
FCMOptions
| Prop | Type |
| ---------- | ------------------- |
| test
| string |
PermissionStatus
| Prop | Type |
| ------------- | ------------------------------------------------------------------------ |
| receive
| PermissionState | 'default' |
DeliveredNotifications
| Prop | Type |
| ------------------- | --------------- |
| notifications
| {} |
PushNotificationSchema
| Prop | Type |
| ------------------ | -------------------- |
| title
| string |
| subtitle
| string |
| body
| string |
| id
| string |
| tag
| string |
| badge
| string |
| notification
| any |
| data
| any |
| clickAction
| string |
| link
| string |
| group
| string |
| groupSummary
| boolean |
Channel
| Prop | Type |
| ----------------- | ------------------------------------------------- |
| id
| string |
| name
| string |
| description
| string |
| sound
| string |
| importance
| Importance |
| visibility
| Visibility |
| lights
| boolean |
| lightColor
| string |
| vibration
| boolean |
ListChannelsResult
| Prop | Type |
| -------------- | --------------- |
| channels
| {} |
Token
| Prop | Type |
| ----------- | ------------------- |
| value
| string |
PluginListenerHandle
| Prop | Type |
| ------------ | ------------------------- |
| remove
| () => any |
RegistrationError
| Prop | Type |
| ----------- | ------------------- |
| error
| string |
ActionPerformed
| Prop | Type |
| ------------------ | ------------------------------------------------------------------------- |
| actionId
| string |
| inputValue
| string |
| notification
| PushNotificationSchema |
Type Aliases
InitializeOptions
InstanceFactoryOptions
PermissionState
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
Importance
1 | 2 | 3 | 4 | 5
Visibility
-1 | 0 | 1