有三个问题:
- 正式打包后的app和运行到手机的调试app生成的cid不同
- 服务端推送,正式app,可以发送成功,但是推送调试app,就提示AppidError
-
正式app,收到厂商通道的离线消息,点击后,可以打开app,但是无法跳转指定的页面。以下是生成推送模板的代码:
TransmissionTemplate template = new TransmissionTemplate(); template.setAppId(appId); template.setAppkey(appKey); template.setTransmissionType(2); if(type.equals("android")) { JSONObject content = new JSONObject(); content.put("title", sysMsgType.getTitle()); content.put("content", sysMsgType.getContent()); JSONObject payload = new JSONObject(); payload.put("url", sysMsgType.getUrl()); payload.put("isTabbar", false); content.put("payload", payload); template.setTransmissionContent(content.toJSONString()); Notify notify = new Notify(); notify.setType(GtReq.NotifyInfo.Type._intent); notify.setTitle(sysMsgType.getTitle()); notify.setContent(sysMsgType.getContent()); notify.setUrl(sysMsgType.getUrl()); notify.setPayload(payload.toJSONString()); StringBuilder sb = new StringBuilder("intent:#Intent;action=android.intent.action.oppopush;launchFlags=0x14000000;component=com.xx.xxx/io.dcloud.PandoraEntry;S.UP-OL-SU=true;"); sb.append("S.title=").append(sysMsgType.getTitle()); sb.append(";S.content=").append(sysMsgType.getContent()); sb.append(";S.payload=").append(payload.toJSONString()); sb.append(";end"); log.debug(sb.toString()); notify.setIntent(sb.toString()); template.set3rdNotifyInfo(notify); }
0 个回复