README.md 828 B

宇光同行工作汇报

个推推送服务集成说明

配置说明

application-dev.yml或相应环境配置文件中添加个推配置:

getui:
  enabled: true  # 是否启用个推服务
  app-id: xxxxxx  # 个推AppId
  app-key: xxxxxx  # 个推AppKey
  app-secret: xxxxxx  # 个推AppSecret
  master-secret: xxxxxx  # 个推MasterSecret

使用方法

// 推送消息给单个用户
GetuiTemplate.pushMessageToSingle("用户的CID", "标题", "内容");

// 推送消息给单个用户(带透传内容)
GetuiTemplate.pushMessageToSingle("用户的CID", "标题", "内容", "{\"type\":\"order\",\"id\":123}");

// 批量推送消息给多个用户
String[] cids = {"用户1的CID", "用户2的CID", "用户3的CID"};
GetuiTemplate.pushMessageToBatch(cids, "标题", "内容");