极光推送(个人自研版)sdk方式整合

极光推送(个人自研版)sdk方式整合,第1张

极光推送(个人自研版)sdk方式整合

工作中遇到了在PC端使用极光推送,索性写下来为以后做些记录
在我们调用别人接口时,会提到鉴权:

鉴权(authentication)是指验证用户是否拥有访问系统的权利。

看样子应该和我们说的shiro异曲同工了

em,怎么说呢,github还是需要网速的

依赖公司如果架构师配过一次了,那就导入前两个

		
			
            cn.jpush.api
            jiguang-common
            1.1.11
        
        
            cn.jpush.api
            jpush-client
            3.3.8
        
        
        io.netty
        netty-all
        4.1.6.Final
        compile
    
    
        com.google.code.gson
        gson
        2.3
    
    
        org.slf4j
        slf4j-api
        1.7.7
    

    
    
        org.slf4j
        slf4j-log4j12
        1.7.7
    
    
        log4j
        log4j
        1.2.17
    

在你的module下编写PushUtils类,

public class PushUtils {
    private static String appKey = "你的appkey";

    private static String masterSecret = "你的masterSecret ";
	
    private static final int RESPONSE_OK = 200;

    private static long jpushTime = 86400L;

    private static final Logger logger = LoggerFactory.getLogger(PushUtils.class);

    JPushClient  jpushClient = new JPushClient(masterSecret, appKey, null, ClientConfig.getInstance());


    public static PushPayload buildPushObject_all_all_alert() {
        return PushPayload.alertAll("1433223");
    }
}

剩下的在jpush-api-java-client-master/README.md下面找自己需要的推送对象.

十年磨一剑,霜刃未曾试.今日把示君,谁有不平事?

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5686294.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存