宝山
宝山
  • 发布:2020-04-14 16:45
  • 更新:2021-12-17 14:11
  • 阅读:1594

unipush 集成后 服务端发送的通知消息 无法唤醒app

分类:uni-app

服务端发送的推送消息 点击后不会唤醒app 在开发者中心发送的推送消息缺可以唤醒APP 知道有可能是什么原因么

2020-04-14 16:45 负责人:无 分享
已邀请:
宝山

宝山 (作者) -

我用的是官网的DEMO app都能收到消息 但是通过代码发送的消息 点击却唤醒不了app

public static void main(String[] args) throws IOException {

    IGtPush push = new IGtPush(url, appKey, masterSecret);  

    Style0 style = new Style0();  
    // STEP2:设置推送标题、推送内容  
    style.setTitle("请输入通知栏标题");  
    style.setText("请输入通知栏内容");  
    style.setLogo("push.png");  // 设置推送图标  
    // STEP3:设置响铃、震动等推送效果  
    style.setRing(true);  // 设置响铃  
    style.setVibrate(true);  // 设置震动  


    // STEP4:选择通知模板  
    NotificationTemplate template = new NotificationTemplate();  
    template.setAppId(appId);  
    template.setAppkey(appKey);  
    template.setStyle(style);  


    // STEP5:定义"AppMessage"类型消息对象,设置推送消息有效期等推送参数  
    List<String> appIds = new ArrayList<String>();  
    appIds.add(appId);  
    AppMessage message = new AppMessage();  
    message.setData(template);  
    message.setAppIdList(appIds);  
    message.setOffline(true);  
    message.setOfflineExpireTime(1000 * 600);  // 时间单位为毫秒  

    // STEP6:执行推送  
    IPushResult ret = push.pushMessageToApp(message);  
    System.out.println(ret.getResponse().toString());  
}
宝山

宝山 (作者) -

开发者中心的确可以唤醒

男色经典

男色经典

我目前也遇到这个问题,请问你解决了么?怎么解决的?

1***@189.cn

1***@189.cn - haokfw

请问最终怎么解决的?

该问题目前已经被锁定, 无法添加新回复