Class IosNotification
- java.lang.Object
-
- cn.jpush.api.push.model.notification.PlatformNotification
-
- cn.jpush.api.push.model.notification.IosNotification
-
- All Implemented Interfaces:
PushModel
public class IosNotification extends PlatformNotification
APNs 通知类
支持 APNs 默认的几个参数:- alert: 继承自父类 PlatformNotification 的 alert 属性;本类设置则覆盖。
- badge: 支持 setBadge(int) 方法来设置;支持 incrBadge(int) 方法来增加。
- sound: 支持 setSound(string) 方法来设置声音文件。或者 setSound(JSON object) 对应官方payload结构
- content-available: 用来支持后台推送。如果该值赋值为 1,表示开启后台推送。
- mutable-content: 通知扩展
- category: IOS 8 才支持。设置 APNs payload 中的 "category" 字段值
- mutable-content: 通知扩展
- extras: JSON object. 支持更多的自定义字段信息。
需要特别留意的是,JPush SDK 会对以下几个值有特别的默认设置考虑:- badge: 默认为 "+1"。如果需要取消 badge 值,需要显式地调用 disableBadge()。
- sound: 默认为 "",即默认的声音提示。如果需要取消 sound 值,即不要声音,需要显式地调用 disableSound()。
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIosNotification.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNOTIFICATION_IOS-
Fields inherited from class cn.jpush.api.push.model.notification.PlatformNotification
ALERT, LOG
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IosNotificationalert(java.lang.String alert)java.lang.StringgetPlatform()static IosNotification.BuildernewBuilder()com.google.gson.JsonElementtoJSON()-
Methods inherited from class cn.jpush.api.push.model.notification.PlatformNotification
getAlert, setAlert
-
-
-
-
Field Detail
-
NOTIFICATION_IOS
public static final java.lang.String NOTIFICATION_IOS
- See Also:
- Constant Field Values
-
-
Method Detail
-
newBuilder
public static IosNotification.Builder newBuilder()
-
alert
public static IosNotification alert(java.lang.String alert)
-
getPlatform
public java.lang.String getPlatform()
- Specified by:
getPlatformin classPlatformNotification
-
toJSON
public com.google.gson.JsonElement toJSON()
- Specified by:
toJSONin interfacePushModel- Overrides:
toJSONin classPlatformNotification
-
-