Mirror API latency when sending something to a timeline

微笑、不失礼 提交于 2019-12-24 00:57:17

问题


It seems that sometimes timeline items (just text) arrive instantly and other times they take forever... Is there a way to send one at precisely the right time?


回答1:


You can send the notification at a precise time.

timelineItem.getNotification()
  .setDeliveryTime(new DateTime(oneMinuteInFuture.getTime()));

That's a java example, where oneMinuteInFuture is a Calendar object set to one minute after now.

What happens when you do this is the card is inserted in the timeline immediately, but the notification is delayed until the specified time. So the card goes in right away and one minute later I get a chime.

There is an unaccepted issue related to this at the issue tracker you might want to star and follow, it appears that this functionality might change in the future.



来源:https://stackoverflow.com/questions/17103365/mirror-api-latency-when-sending-something-to-a-timeline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!