本文整理汇总了Java中cn.jpush.api.push.model.notification.Notification类的典型用法代码示例。如果您正苦于以下问题:Java Notification类的具体用法?Java Notification怎么用?Java Notification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Notification类属于cn.jpush.api.push.model.notification包,在下文中一共展示了Notification类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildPushObject_android_regId_alert
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
private static PushPayload buildPushObject_android_regId_alert(String pushAlert, String pushTitle, List<String> regIds) {
Map<String, String> extras = new HashMap<String, String>();
extras.put("extra_1", "val1");
extras.put("extra_2", "val2");
return PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.registrationId(regIds))
.setNotification(Notification
.newBuilder()
.setAlert(pushAlert)
.addPlatformNotification(AndroidNotification.newBuilder()
.setTitle(pushTitle)
.addExtras(extras)
.build())
.build())
.build();
}
示例2: buildPushObject_id_alert_title_extra
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
/**
*
* @param MSG_CONTENT 消息内容
* @param ALERT alert
* @param TITLE 标题 //ios没有title
* @param extra 附加参数
* @param regid 用户注册id
* @return
*/
public PushPayload buildPushObject_id_alert_title_extra(String ALERT,String TITLE,Map<String, String> extra,String regId) {
Audience registrationId;
if(regId!=null){
registrationId = Audience.registrationId(regId);
}else{
registrationId = Audience.all();
}
return PushPayload.newBuilder()
.setPlatform(Platform.android_ios())
.setAudience(registrationId)
.setNotification(Notification.newBuilder()
.setAlert(ALERT)
.addPlatformNotification(AndroidNotification.newBuilder()
.setTitle(TITLE).addExtras(extra).build())
.addPlatformNotification(IosNotification.newBuilder()
.incrBadge(1)
.addExtras(extra).build())
.build())
//.setMessage(Message.content(MSG_CONTENT))
.build();
}
示例3: buildPushObjec_Tag
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
private PushPayload buildPushObjec_Tag(String type, String title, String msg, Map<String, String> extras,String[] tags) {
if(null == extras){
extras = new HashMap<String,String>();
}
return PushPayload.newBuilder()
.setPlatform(Platform.all())
.setAudience(Audience.newBuilder()
.addAudienceTarget(AudienceTarget.tag_and(tags))
.build())
.setMessage(Message.newBuilder()
.setMsgContent(type)
.addExtras(extras)
.build()).setOptions(Options.newBuilder()
.setApnsProduction(true)
.build())
.setNotification(Notification.android(msg, title, extras).ios(title, extras))
.build();
}
示例4: buildPushObject_Alias
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
private PushPayload buildPushObject_Alias(String type, String title, String msg, Map<String, String> extras,String[] alias) {
if(null == extras){
extras = new HashMap<String,String>();
}
return PushPayload.newBuilder()
.setPlatform(Platform.all())
.setAudience(Audience.newBuilder()
.addAudienceTarget(AudienceTarget.alias(alias))
.build())
.setMessage(Message.newBuilder()
.setMsgContent(type)
.addExtras(extras)
.build()).setOptions(Options.newBuilder()
.setApnsProduction(true)
.build())
.setNotification(Notification.android(msg, title, extras).ios(title, extras))
.build();
}
示例5: buildPushObjec_Tag_Android
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
private PushPayload buildPushObjec_Tag_Android(String type, String title, String msg, Map<String, String> extras,String[] tags) {
if(null == extras){
extras = new HashMap<String,String>();
}
return PushPayload.newBuilder()
.setPlatform(Platform.all())
.setAudience(Audience.newBuilder()
.addAudienceTarget(AudienceTarget.tag_and(tags))
.build())
.setMessage(Message.newBuilder()
.setMsgContent(type)
.addExtras(extras)
.build()).setOptions(Options.newBuilder()
.setApnsProduction(true)
.build())
.setNotification(Notification.android(msg, title, extras))
.build();
}
示例6: buildPushObject_Alias_Android
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
private PushPayload buildPushObject_Alias_Android(String type, String title, String msg, Map<String, String> extras,String[] alias) {
if(null == extras){
extras = new HashMap<String,String>();
}
return PushPayload.newBuilder()
.setPlatform(Platform.all())
.setAudience(Audience.newBuilder()
.addAudienceTarget(AudienceTarget.alias(alias))
.build())
.setMessage(Message.newBuilder()
.setMsgContent(type)
.addExtras(extras)
.build()).setOptions(Options.newBuilder()
.setApnsProduction(true)
.build())
.setNotification(Notification.android(msg, title, extras))
.build();
}
示例7: buildPushObjec_Tag_IOS
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
private PushPayload buildPushObjec_Tag_IOS(String type, String title,Map<String, String> extras,String[] tags) {
if(null == extras){
extras = new HashMap<String,String>();
}
return PushPayload.newBuilder()
.setPlatform(Platform.all())
.setAudience(Audience.newBuilder()
.addAudienceTarget(AudienceTarget.tag_and(tags))
.build())
.setMessage(Message.newBuilder()
.setMsgContent(type)
.addExtras(extras)
.build()).setOptions(Options.newBuilder()
.setApnsProduction(true)
.build())
.setNotification(Notification.ios(title, extras))
.build();
}
示例8: buildPushObject_Alias_IOS
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
private PushPayload buildPushObject_Alias_IOS(String type, String title,Map<String, String> extras,String[] alias) {
if(null == extras){
extras = new HashMap<String,String>();
}
return PushPayload.newBuilder()
.setPlatform(Platform.all())
.setAudience(Audience.newBuilder()
.addAudienceTarget(AudienceTarget.alias(alias))
.build())
.setMessage(Message.newBuilder()
.setMsgContent(type)
.addExtras(extras)
.build()).setOptions(Options.newBuilder()
.setApnsProduction(true)
.build())
.setNotification(Notification.ios(title, extras))
.build();
}
示例9: buildPushObject_ios_tagAnd_alertWithExtrasAndMessage
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
public static PushPayload buildPushObject_ios_tagAnd_alertWithExtrasAndMessage(String message, String msg_content) {
return PushPayload.newBuilder()
.setPlatform(Platform.ios())
.setAudience(Audience.tag_and("tag1", "tag_all"))
.setNotification(Notification.newBuilder()
.addPlatformNotification(IosNotification.newBuilder()
.setAlert(message)
.setBadge(5)
.setSound("happy")
.addExtra("from", "JPush")
.build())
.build())
.setMessage(Message.content(msg_content))
.setOptions(Options.newBuilder()
.setApnsProduction(true)
.build())
.build();
}
示例10: buildPushObject_android_tags_alert
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
/**
*
* @Title: buildPushObject_all_tags_teacher_alert
* @Description: TODO(学生端)
* @return
* PushPayload
*/
private static PushPayload buildPushObject_android_tags_alert(String tag, String pushAlert, String pushTitle) {
return PushPayload.newBuilder()
.setPlatform(Platform.android())//设置接受的平台
.setAudience(Audience.tag(tag))//Audience设置为all,说明采用广播方式推送,所有用户都可以接收到
.setNotification(Notification.newBuilder()
.setAlert(pushAlert)
.addPlatformNotification(AndroidNotification.newBuilder()
.setTitle(pushTitle).build())
.build())
.build();
}
示例11: sendAndroidNotificationWithAlias
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
public PushResult sendAndroidNotificationWithAlias(String title, String alert,
Map<String, String> extras, String... alias)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.alias(alias))
.setNotification(Notification.android(alert, title, extras))
.build();
return _pushClient.sendPush(payload);
}
示例12: sendAndroidNotificationWithRegistrationID
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
public PushResult sendAndroidNotificationWithRegistrationID(String title, String alert,
Map<String, String> extras, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.android())
.setAudience(Audience.registrationId(registrationID))
.setNotification(Notification.android(alert, title, extras))
.build();
return _pushClient.sendPush(payload);
}
示例13: sendIosNotificationWithAlias
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
public PushResult sendIosNotificationWithAlias(String alert,
Map<String, String> extras, String... alias)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.ios())
.setAudience(Audience.alias(alias))
.setNotification(Notification.ios(alert, extras))
.build();
return _pushClient.sendPush(payload);
}
示例14: sendIosNotificationWithRegistrationID
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
public PushResult sendIosNotificationWithRegistrationID(String alert,
Map<String, String> extras, String... registrationID)
throws APIConnectionException, APIRequestException {
PushPayload payload = PushPayload.newBuilder()
.setPlatform(Platform.ios())
.setAudience(Audience.registrationId(registrationID))
.setNotification(Notification.ios(alert, extras))
.build();
return _pushClient.sendPush(payload);
}
示例15: PushPayload
import cn.jpush.api.push.model.notification.Notification; //导入依赖的package包/类
private PushPayload(Platform platform, Audience audience,
Notification notification, Message message, Options options, SMS sms) {
this.platform = platform;
this.audience = audience;
this.notification = notification;
this.message = message;
this.options = options;
this.sms = sms;
}