【发布时间】:2019-03-05 05:40:36
【问题描述】:
我正在尝试通过 Firebase 云消息传递向多个用户(WEB、WAP)发送通知。 但我无法设置通知的生存时间。
Map<String, String> map = new HashMap<>();
map.put("status", article.getStatus());
map.put("headLine", article.getHeadLine());
map.put("caption", article.getCaption());
map.put("thumb", article.getThumb());
map.put("tag", article.getTag());
map.put("webUrl", article.getWebUrl());
map.put("category", article.getCategory());
WebpushConfig webpushConfig = WebpushConfig.builder().putAllData(map).putHeader("TTL", ttl + "").build();
Message message = Message.builder()
.setWebpushConfig(webpushConfig)
.putAllData(map)
.setTopic(id)
.build();
String response = FirebaseMessaging.getInstance().send(message);
【问题讨论】:
-
您最终找到解决方案了吗?
标签: java firebase firebase-cloud-messaging