信鸽推送是比较流行的app推送。关键是免费。示例实现了:单设备推送,多设备推送。
整体项目
pom配置
核心引入jar包
<dependency>
<groupId>com.github.xingePush</groupId>
<artifactId>xinge</artifactId>
<version>1.1.8</version>
</dependency>
核心代码
XinGePushConfig信鸽的配置类
@Component
@ConfigurationProperties(prefix = "xinge.push")
@Data
public class XinGePushConfig implements Serializable {
private static final long serialVersionUID = 4102961101639098396L;
/**
* 应用唯一标识,可在xg.qq.com管理台查看
*/
private Long accessId;
/**
* 接口秘钥
*/
private String secretKey;
}
XinGePushService信鸽推送的服务接口;
XinGePushServiceImpl信鸽推送的服务接口实现;
ChapterXingeApplicationTests单元测试类;
配置
application.properties
xinge.push.accessId=xxx
xinge.push.secretKey=xxxxxx
本文为博主原创文章,未经博主允许不得转载。
更多内容请访问:IT源点
注意:本文归作者所有,未经作者允许,不得转载