• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PushResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中cn.jpush.api.push.PushResult的典型用法代码示例。如果您正苦于以下问题:Java PushResult类的具体用法?Java PushResult怎么用?Java PushResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PushResult类属于cn.jpush.api.push包,在下文中一共展示了PushResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: pushByRegId

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
/**
 * 按regId推送通知给教师端
 */
@Override
public BasicVo pushByRegId(List<JPushByTeacherVo> teachers) {
	
	if(teachers.size() == 0) {
		return new BasicVo(JPushBusinessCode.BUSSINESS_PUSH_EMPTY[0], JPushBusinessCode.BUSSINESS_PUSH_EMPTY[1]);
	}
	
	String pushAlert = "马上上课了,记得打开软件考勤哦!";
	String pushTitle = "考勤提醒";
	
	List<String> regIds = new ArrayList<String>();
	for(JPushByTeacherVo jt : teachers) {
		regIds.add(jt.getTeacherRegId());
	}
	PushResult pushResult = JPushUtils.sendPushByAndroidRegId(pushAlert, pushTitle, regIds);
	
	if(null == pushResult) {
		return new BasicVo(JPushBusinessCode.BUSSINESS_FAILED[0], JPushBusinessCode.BUSSINESS_FAILED[1]);
	}
	
	return new BasicVo(JPushBusinessCode.BUSINESS_SUCCESS[0], JPushBusinessCode.BUSINESS_SUCCESS[1]);
}
 
开发者ID:IaHehe,项目名称:classchecks,代码行数:26,代码来源:JPushServiceImpl.java


示例2: pushStuClockByRegId

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
/**
 * 推送通知给学生,按regID列表
 */
@Override
public BasicVo pushStuClockByRegId(List<String> regIds) {
	if(regIds.size() == 0) {
		return new BasicVo(JPushBusinessCode.BUSSINESS_PUSH_EMPTY[0], JPushBusinessCode.BUSSINESS_PUSH_EMPTY[1]);
	}
	
	String pushAlert = "你当前教师考勤没有通过,请打开软件自己考勤";
	String pushTitle = "考勤提醒";
	
	PushResult pushResult = JPushUtils.sendPushByAndroidRegId(pushAlert, pushTitle, regIds);
	if(null == pushResult) {
		return new BasicVo(JPushBusinessCode.BUSSINESS_FAILED[0], JPushBusinessCode.BUSSINESS_FAILED[1]);
	}
	
	return new BasicVo(JPushBusinessCode.BUSINESS_SUCCESS[0], JPushBusinessCode.BUSINESS_SUCCESS[1]);
}
 
开发者ID:IaHehe,项目名称:classchecks,代码行数:20,代码来源:JPushServiceImpl.java


示例3: sendByAlias

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
private boolean sendByAlias(String type, String title, String msg, Map<String,String> extras, String[] alias){
		boolean result = false;
		try {
			PushPayload pl = buildPushObject_Alias(type, title, msg, extras, alias);
			PushResult pr = client.sendPush(pl);
			result = pr.isResultOK();
			
//			extras.put("MESSAGE", msg);
//			pl = buildPushObject_Alias_IOS(type, title, extras, alias);
//			pr = client.sendPush(pl);
//			result = pr.isResultOK() && result;
		} catch (Exception e) {
			e.printStackTrace();
			result = false;
		}
		return result;
	}
 
开发者ID:anylineorg,项目名称:anyline,代码行数:18,代码来源:JPushUtil.java


示例4: sendByTag

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
private boolean sendByTag(String type, String title, String msg, Map<String,String> extras, String[] tags){
		boolean result = false;
		try {
			extras.put("MESSAGE", msg);
			extras.put("TITLE", title);
//			
			PushPayload pl = buildPushObjec_Tag_Android(type, title, msg, extras, tags);
			PushResult pr = client.sendPush(pl);
			result = pr.isResultOK();
////			
//			System.out.println(extras);
//			pl = buildPushObjec_Tag_IOS(type, title, extras, tags);
//			pr = client.sendPush(pl);
//			result = pr.isResultOK() && result;
		} catch (Exception e) {
			e.printStackTrace();
			result = false;
		}
		return result;
	}
 
开发者ID:anylineorg,项目名称:anyline,代码行数:21,代码来源:JPushUtil.java


示例5: sendAndroidNotificationWithAlias

import cn.jpush.api.push.PushResult; //导入依赖的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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:11,代码来源:JPushClient.java


示例6: sendAndroidNotificationWithRegistrationID

import cn.jpush.api.push.PushResult; //导入依赖的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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:11,代码来源:JPushClient.java


示例7: sendIosNotificationWithAlias

import cn.jpush.api.push.PushResult; //导入依赖的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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:11,代码来源:JPushClient.java


示例8: sendIosNotificationWithRegistrationID

import cn.jpush.api.push.PushResult; //导入依赖的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);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:11,代码来源:JPushClient.java


示例9: sendAndroidMessageWithAlias

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
public PushResult sendAndroidMessageWithAlias(String title, String msgContent, String... alias) 
        throws APIConnectionException, APIRequestException {
    PushPayload payload = PushPayload.newBuilder()
            .setPlatform(Platform.android())
            .setAudience(Audience.alias(alias))
            .setMessage(Message.newBuilder()
                    .setTitle(title)
                    .setMsgContent(msgContent)
                    .build())
            .build();
    return _pushClient.sendPush(payload);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:13,代码来源:JPushClient.java


示例10: sendAndroidMessageWithRegistrationID

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
public PushResult sendAndroidMessageWithRegistrationID(String title, String msgContent, String... registrationID) 
        throws APIConnectionException, APIRequestException {
    PushPayload payload = PushPayload.newBuilder()
            .setPlatform(Platform.android())
            .setAudience(Audience.registrationId(registrationID))
            .setMessage(Message.newBuilder()
                    .setTitle(title)
                    .setMsgContent(msgContent)
                    .build())
            .build();
    return _pushClient.sendPush(payload);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:13,代码来源:JPushClient.java


示例11: sendIosMessageWithAlias

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
public PushResult sendIosMessageWithAlias(String title, String msgContent, String... alias) 
        throws APIConnectionException, APIRequestException {
    PushPayload payload = PushPayload.newBuilder()
            .setPlatform(Platform.ios())
            .setAudience(Audience.alias(alias))
            .setMessage(Message.newBuilder()
                    .setTitle(title)
                    .setMsgContent(msgContent)
                    .build())
            .build();
    return _pushClient.sendPush(payload);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:13,代码来源:JPushClient.java


示例12: sendIosMessageWithRegistrationID

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
public PushResult sendIosMessageWithRegistrationID(String title, String msgContent, String... registrationID) 
        throws APIConnectionException, APIRequestException {
    PushPayload payload = PushPayload.newBuilder()
            .setPlatform(Platform.ios())
            .setAudience(Audience.registrationId(registrationID))
            .setMessage(Message.newBuilder()
                    .setTitle(title)
                    .setMsgContent(msgContent)
                    .build())
            .build();
    return _pushClient.sendPush(payload);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:13,代码来源:JPushClient.java


示例13: sendMessageWithRegistrationID

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
public PushResult sendMessageWithRegistrationID(String title, String msgContent, String... registrationID) 
        throws APIConnectionException, APIRequestException {
    PushPayload payload = PushPayload.newBuilder()
            .setPlatform(Platform.all())
            .setAudience(Audience.registrationId(registrationID))
            .setMessage(Message.newBuilder()
                    .setTitle(title)
                    .setMsgContent(msgContent)
                    .build())
            .build();
    return _pushClient.sendPush(payload);
}
 
开发者ID:cowthan,项目名称:JavaAyo,代码行数:13,代码来源:JPushClient.java


示例14: push

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
@Override
public boolean push(String alias, List<String> pushTags, String alert) {
    try{
        logger.info("push():alias:"+alias+"  pushTags:"+pushTags+"  alert:"+alert);

        JPushClient jpushClient = getJpushClient();
        Builder  builder =  PushPayload.newBuilder()
                .setPlatform(Platform.all());//所有平台
        if(StringUtils.isNotBlank(alias)){        
            builder = builder.setAudience(Audience.alias(alias));//向选定的人推送
        }
        if(pushTags!=null && pushTags.size()>0){
           builder = builder.setAudience(Audience.tag(pushTags));//根据标签推送
        }
        if(StringUtils.isBlank(alias) && (pushTags==null || pushTags.size()==0)){
            builder = builder.setAudience(Audience.all());
        }
      //  PushPayload pushPayload = PushPayload.alertAll(content);
        PushPayload pushPayload = builder.setNotification(Notification.alert( alert))//消息内容
                .build();
        logger.info("push():pushPayload:"+pushPayload);
        PushResult result = jpushClient.sendPush(pushPayload);
        logger.info("push():result:"+result);
        return result.isResultOK();
    }catch(Exception e){
        logger.error("push():e:"+e.getMessage(),e);
        return false;
    }
}
 
开发者ID:cpusoft,项目名称:common,代码行数:30,代码来源:AppPushServiceImpl.java


示例15: sendAndroidNotificationWithAlias

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
/**
 * Shortcut
 */
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);
}
 
开发者ID:Wccczy,项目名称:Student_Register,代码行数:14,代码来源:JPushClient.java


示例16: sendAndroidNotificationWithRegistrationID

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
/**
 * Shortcut
 */
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);
}
 
开发者ID:Wccczy,项目名称:Student_Register,代码行数:14,代码来源:JPushClient.java


示例17: sendIosNotificationWithAlias

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
/**
 * Shortcut
 */
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);
}
 
开发者ID:Wccczy,项目名称:Student_Register,代码行数:14,代码来源:JPushClient.java


示例18: sendIosNotificationWithRegistrationID

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
/**
 * Shortcut
 */
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);
}
 
开发者ID:Wccczy,项目名称:Student_Register,代码行数:14,代码来源:JPushClient.java


示例19: sendAndroidMessageWithAlias

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
/**
 * Shortcut
 */
public PushResult sendAndroidMessageWithAlias(String title, String msgContent, String... alias)
        throws APIConnectionException, APIRequestException {
    PushPayload payload = PushPayload.newBuilder()
            .setPlatform(Platform.android())
            .setAudience(Audience.alias(alias))
            .setMessage(Message.newBuilder()
                    .setTitle(title)
                    .setMsgContent(msgContent)
                    .build())
            .build();
    return _pushClient.sendPush(payload);
}
 
开发者ID:Wccczy,项目名称:Student_Register,代码行数:16,代码来源:JPushClient.java


示例20: sendAndroidMessageWithRegistrationID

import cn.jpush.api.push.PushResult; //导入依赖的package包/类
/**
 * Shortcut
 */
public PushResult sendAndroidMessageWithRegistrationID(String title, String msgContent, String... registrationID)
        throws APIConnectionException, APIRequestException {
    PushPayload payload = PushPayload.newBuilder()
            .setPlatform(Platform.android())
            .setAudience(Audience.registrationId(registrationID))
            .setMessage(Message.newBuilder()
                    .setTitle(title)
                    .setMsgContent(msgContent)
                    .build())
            .build();
    return _pushClient.sendPush(payload);
}
 
开发者ID:Wccczy,项目名称:Student_Register,代码行数:16,代码来源:JPushClient.java



注:本文中的cn.jpush.api.push.PushResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AxisSweep3类代码示例发布时间:2022-05-22
下一篇:
Java Base64类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap