Mirror API latency when sending something to a tim

2019-07-20 02:03发布

问题:

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.