@vaecebyz/capacitor-getui
v0.1.4
Published
Capacitor Getui Plugin
Readme
@vaecebyz/capacitor-getui
getui
Install
npm install @vaecebyz/capacitor-getui
npx cap syncAPI
echo(...)init()getVersion()getClientId()setTag(...)turnOnPush()turnOffPush()setSilentTime(...)isPushTurnedOn()areNotificationsEnabled()openNotification()setHwBadgeNum(...)setOPPOBadgeNum(...)setVivoAppBadgeNum(...)addListener('onReceiveClientId', ...)addListener('onReceiveMessageData', ...)addListener('localNotificationReceived', ...)addListener(string, ...)- Interfaces
TypeScript definitions mapping to native @PluginMethod methods in GetuiPlugin.java
echo(...)
echo(options: { value: string; }) => any原样返回输入,调试用
| Param | Type |
| ------------- | ------------------------------- |
| options | { value: string; } |
Returns: any
init()
init() => any初始化个推 SDK,返回版本与当前 clientId(若已生成)
Returns: any
getVersion()
getVersion() => any获取当前 SDK 版本
Returns: any
getClientId()
getClientId() => any获取当前设备 clientId
Returns: any
setTag(...)
setTag(options: { tags: string[]; sn?: string; }) => any设置标签
| Param | Type |
| ------------- | --------------------------------------- |
| options | { tags: {}; sn?: string; } |
Returns: any
turnOnPush()
turnOnPush() => any打开推送
Returns: any
turnOffPush()
turnOffPush() => any关闭推送
Returns: any
setSilentTime(...)
setSilentTime(options: { begin_hour: number; duration: number; }) => any设定静默时间(单位:小时),begin_hour:0-23, duration: 持续小时
| Param | Type |
| ------------- | ------------------------------------------------------ |
| options | { begin_hour: number; duration: number; } |
Returns: any
isPushTurnedOn()
isPushTurnedOn() => any查询推送是否开启
Returns: any
areNotificationsEnabled()
areNotificationsEnabled() => any系统通知权限是否开启
Returns: any
openNotification()
openNotification() => any打开系统通知设置页
Returns: any
setHwBadgeNum(...)
setHwBadgeNum(options: { num: number; }) => any设置华为角标
| Param | Type |
| ------------- | ----------------------------- |
| options | { num: number; } |
Returns: any
setOPPOBadgeNum(...)
setOPPOBadgeNum(options: { num: number; }) => any设置 OPPO 角标
| Param | Type |
| ------------- | ----------------------------- |
| options | { num: number; } |
Returns: any
setVivoAppBadgeNum(...)
setVivoAppBadgeNum(options: { num: number; }) => any设置 vivo 角标
| Param | Type |
| ------------- | ----------------------------- |
| options | { num: number; } |
Returns: any
addListener('onReceiveClientId', ...)
addListener(eventName: 'onReceiveClientId', listenerFunc: (data: { client_id?: string; online?: boolean; }) => void) => any添加事件监听(Capacitor 自动注入类型)
| Param | Type |
| ------------------ | ------------------------------------------------------------------------- |
| eventName | 'onReceiveClientId' |
| listenerFunc | (data: { client_id?: string; online?: boolean; }) => void |
Returns: any
addListener('onReceiveMessageData', ...)
addListener(eventName: 'onReceiveMessageData', listenerFunc: (data: any) => void) => any| Param | Type |
| ------------------ | ----------------------------------- |
| eventName | 'onReceiveMessageData' |
| listenerFunc | (data: any) => void |
Returns: any
addListener('localNotificationReceived', ...)
addListener(eventName: 'localNotificationReceived', listenerFunc: (data: any) => void) => any| Param | Type |
| ------------------ | ---------------------------------------- |
| eventName | 'localNotificationReceived' |
| listenerFunc | (data: any) => void |
Returns: any
addListener(string, ...)
addListener(eventName: string, listenerFunc: (data: any) => void) => any| Param | Type |
| ------------------ | ----------------------------------- |
| eventName | string |
| listenerFunc | (data: any) => void |
Returns: any
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ------------------------- |
| remove | () => any |
