即时通讯
当前页

Interface

2026-05-25
ZPNsConfigZPNsIOSNotificationArrivedConfig
ZPNsLocalMessageZPNsMessage
ZPNsNotificationChannelZPNsRegisterConfig
ZPNsRegisterMessage

ZPNsConfig

ZPNs 推送配置类。

详情

ZPNs 推送配置类。

  • 业务场景:在该类添加各厂商推送所需的配置项以及是否开启的布尔值。

属性

enableHWPush

enableHWPush
enableHWPush: boolean

是否开启华为推送布尔值。

enableMiPush

enableMiPush
enableMiPush: boolean

是否开启小米推送的布尔值。

enableVivoPush

enableVivoPush
enableVivoPush: boolean

是否开启 vivo 推送的布尔值。

miAppID

miAppID
miAppID: string

小米推送所需 AppID。

miAppKey

miAppKey
miAppKey: string

小米推送所需AppKey。

oppoAppID

oppoAppID
oppoAppID: string

oppo 推送所需 AppID。

oppoAppSecret

oppoAppSecret
oppoAppSecret: string

oppo 推送所需的AppSecret。

oppoAppKey

oppoAppKey
oppoAppKey: string

oppo 推送所需的 AppKey。

vivoAppID

vivoAppID
vivoAppID: string

vivo 推送所需的 AppID。

vivoAppKey

vivoAppKey
vivoAppKey: string

vivo 推送所需的 AppKey。

hwAppID

hwAppID
hwAppID: string

华为推送所需的 AppID。

enableFCMPush

enableFCMPush
enableFCMPush: boolean

是否开启谷歌推送布尔值。

enableOppoPush

enableOppoPush
enableOppoPush: boolean

是否开启 oppo 推送的布尔值。

enableHwBadge

enableHwBadge
enableHwBadge: boolean

当该设备为华为设备,并且做为接收端需要开启角标功能时设置为 true。

  • 业务场景:请在 registerPush 调用前填写,并通过 setPushConfig 接口传入 ZPNs。
  • 是否必填:非必填。
  • 默认值:默认为 false。

apptype

apptype
private apptype: number

用于指定当前项目对应 ZEGO 控制台的第几套离线推送配置。

  • 业务场景:如需在不同 bundleID / 包名上使用相同的 AppID 时。
  • 是否必填:非必填。
  • 默认值:不设置该值的话,默认为第一套(1)。
  • 建议值:应当与当前 bundle ID/包名相关的离线推送证书在 ZEGO 控制台上配置的 App type 保持一致。比如第二套的话这里填 2 。

ZPNsIOSNotificationArrivedConfig

可在注册离线推送时指定是否展示 iOS 推送的弹窗、声音和角标。

详情

可在注册离线推送时指定是否展示 iOS 推送的弹窗、声音和角标。

属性

isPresentBadge

isPresentBadge
isPresentBadge: boolean

iOS 在前台收到推送时,是否修改角标。

isPresentSound

isPresentSound
isPresentSound: boolean

iOS 在前台收到推送时,是否有铃声。

isPresentAlert

isPresentAlert
isPresentAlert: boolean

iOS 在前台收到推送时,是否有通知弹窗。

ZPNsLocalMessage

描述添加本地通知的消息类。

属性

title

title
title: string

通知标题。

content

content
content: string

通知内容。

payload

payload
payload: string

通知附加信息。

channelID

channelID
channelID: string

通道ID。

iOSSound

iOSSound
iOSSound: string

iOS 平台声音文件的名称。

androidSound

androidSound
androidSound: string

Android 平台声音文件的名称。

ZPNsMessage

ZPNs 消息类。

详情

ZPNs 消息类。

  • 业务场景:使用此数据类的对象获取推送信息的详细内容。

属性

title

title
title: string

消息标题, 如果是通知栏消息,则为通知栏标题。

content

content
content: string

消息内容,如果是通知栏则为消息通知栏内容,如果为透传消息,则为透传消息体。

  • 注意事项:oppo 所有键值大小加起来不超过500个字符(备注:目前是每个值50个字符内,后续调整)。

pushSourceType

pushSourceType
pushSourceType: ZPNsPushSourceType

push 来源。

extras

extras
extras: Record<string, any>

各个平台的传递的源对象, 需要判断进行类型转换。

ZPNsNotificationChannel

描述通知通道的类。

属性

channelID

channelID
channelID: string

通道 ID。

channelName

channelName
channelName: string

通道名称。

androidSound

androidSound
androidSound: string

Android 平台声音文件的名称。

ZPNsRegisterConfig

ZPNs 注册推送配置类。

详情

ZPNs 注册推送配置类。

属性

androidEnvironment

androidEnvironment
androidEnvironment: ZPNsEnvironment

Android 开发环境。

iOSEnvironment

iOSEnvironment
iOSEnvironment: ZPNsEnvironment

iOS 的证书环境。

enableIOSVoIP

enableIOSVoIP
enableIOSVoIP: boolean

iOS 是否启用 VoIP。

iOSNotificationArrivedConfig

iOSNotificationArrivedConfig
iOSNotificationArrivedConfig: ZPNsIOSNotificationArrivedConfig

iOS 设置当常规警报通知到达前台时,是显示警报、徽章还是声音。

ZPNsRegisterMessage

描述厂商推送 token 信息的消息类。

详情

描述厂商推送 token 信息的消息类。

  • 业务场景:onRegister 被触发时会返回一个该数据类的对象,携带有关厂商推送 token 信息的消息类。

属性

errorCode

errorCode
errorCode: number

ZPNs 错误码。

pushID

pushID
pushID: string

ZPNs 生成的推送 ID。

上一篇

Class

下一篇

Enum

当前页

返回到顶部