message

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Custom

type Custom struct {
	// 【可选】消息标题。
	Title string `json:"title,omitempty"`
	// 【必填】消息内容本身。
	Content string `json:"msg_content"`
	// 【可选】消息内容类型,开发者可根据自身业务定义具体类型。
	ContentType string `json:"content_type,omitempty"`
	// 【可选】个性化文案 - 备用标题
	AlternateTitle string `json:"alternate_title,omitempty"`
	// 【可选】个性化文案 - 备用内容
	AlternateContent string `json:"alternate_content,omitempty"`
	// 【可选】可选参数。
	Extras map[string]interface{} `json:"extras,omitempty"`
}

自定义消息内容。

自定义消息,又称作:应用内消息,透传消息。

  • 此部分内容不会展示到通知栏上,JPush SDK 收到消息内容后透传给 APP,需要 APP 自行处理;
  • iOS 在推送应用内消息通道(非 APNs)获取此部分内容,需 APP 处于前台;
  • 鸿蒙平台(HarmonyOS)从 2024.08.13 开始支持自定义消息,对应 JPush HarmonyOS SDK v1.1.0 版本。

详见文档:https://docs.jiguang.cn/jpush/server/push/rest_api_v3_push#message%EF%BC%9A%E8%87%AA%E5%AE%9A%E4%B9%89%E6%B6%88%E6%81%AF

type InApp

type InApp struct {
	// 【必填】面向通知栏消息,是否启用应用内增强提醒功能。
	Enabled bool `json:"inapp_message"`
}

应用内增强提醒。

  • 此功能生效需 Android push SDK ≥ v3.9.0、iOS push SDK ≥ v3.4.0,若低于此版本按照原流程执行;
  • 面向于通知栏消息类型,需搭配 Notification 参数一起使用,对于通知权限关闭的用户可设置启用此功能。此功能启用后,当用户前台运行 APP 时,会通过应用内消息的方式展示通知栏消息内容。

详见文档:https://docs.jiguang.cn/jpush/server/push/rest_api_v3_push#inapp_message%EF%BC%9A%E5%BA%94%E7%94%A8%E5%86%85%E5%A2%9E%E5%BC%BA%E6%8F%90%E9%86%92

type SMS

type SMS struct {
	// 【必填】短信补充的内容模板 ID,没有填写该字段即表示不使用短信补充功能。
	TempID int64 `json:"temp_id"`
	// 【可选】签名 ID,该字段为空则使用应用默认签名。
	SignID int `json:"signid,omitempty"`
	// 【必填】短信发送的延迟时间,若在设定的时间内没有推送成功,则下发短信。
	//  - 设置为 0,表示立即发送短信,即通知和短信并发;
	//  - 设置为非 0,表示若在设定的时间内没有推送成功,则进行短信补发;
	//  - 单位为秒,不能超过 24 小时;
	//  - 该参数仅对 Android 和 iOS 平台有效。
	DelayTime int `json:"delay_time"`
	// 【可选】是否对补发短信的用户进行活跃过滤。
	ActiveFilter *bool `json:"active_filter,omitempty"`
	// 【可选】短信模板中的参数。
	TempParams map[string]interface{} `json:"temp_para,omitempty"`
}

短信渠道补充送达内容。

  • 需要先把用户的手机号码与设备标识 Registration ID 匹配;
  • 短信补发:在指定时间之内,判断推送是否成功,若没有达到成功标准则补发短信,请设置 DelayTime 为非 0 值;
  • 短信并发:极光推送支持同时下发推送和短信,请设置 DelayTime 为 0。

详见文档:https://docs.jiguang.cn/jpush/server/push/rest_api_v3_push#sms_message%EF%BC%9A%E7%9F%AD%E4%BF%A1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL