3

With a couple of timeline items sharing the same bundle ID, I create the bundle cover with:

TimelineItem timelineCover = new TimelineItem();
timelineCover.setText("Help Options");
timelineCover.setBundleId(bundleId);
timelineCover.setNotification(new NotificationConfig().setLevel("DEFAULT"));
timelineCover.setIsBundleCover(true);
timelineCover.setIsPinned(true);
MirrorClient.insertTimelineItem(credential, timelineCover);

It comes through to the timeline properly bundled but with isPinned = false.

I tried updating the isPinned field to true in the timeline playground but it stays false.

Is it possible to pin a bundle?

mimming
  • 13,974
  • 3
  • 45
  • 74
Daniel Kaplan
  • 222
  • 1
  • 8

2 Answers2

3

The isPinned property cannot be directly set to true. Your user must pin the card themselves using the TOGGLE_PINNED built-in menu item.

Your code for the timeline item insert would look like this:

TimelineItem timelineCover = new TimelineItem();
timelineCover.setText("Help Options");
timelineCover.setBundleId(bundleId);
timelineCover.setNotification(new NotificationConfig().setLevel("DEFAULT"));
timelineCover.setIsBundleCover(true);

List<MenuItem> menuItemList = new ArrayList<MenuItem>();
menuItemList.add(new MenuItem().setAction("TOGGLE_PINNED"));
timelineCover.setMenuItems(menuItemList);

MirrorClient.insertTimelineItem(credential, timelineCover);

Once inserted your user could use the menu to make this card pinned.

mimming
  • 13,974
  • 3
  • 45
  • 74
  • Right, but when you select it, the bundle's cards will show instead of the menu items. Can a bundle cover have menu items? – Daniel Kaplan Jun 05 '13 at 23:17
  • 1
    By default, the code card is also inside the bundle. The menu item will show up there. But I understand your point. Pinning and bundles are a complicated matter at the moment. – mimming Jun 05 '13 at 23:35
  • 1
    I'm not sure what you mean by "code card." I put the TOGGLE_PINNED menu item on all of the cards in the bundle so I can use any of them to pin the whole bundle. Thanks for your help. – Daniel Kaplan Jun 06 '13 at 00:35
3

You can only pin a bundle by setting a non-cover item of the bundle to have the menu action TOGGLE_PINNED, and then the user has to tap on the cover, drill into a child card that can be pinned, tap it for the pin option and then pin it. This has the result of pinning the entire bundle, including the cover which as David pointed out in a comment, even when set to be able to be pinned, can't since clicking it just goes into the bundle.

Something else related in that it's also kind of weird and related to bundles, is that if you allow a user to delete the cover of a bundle, and they do, the children do not get deleted, instead the most recently added card becomes the new cover.

I think this is a great question. Thanks for it Daniel.

Mark Scheel
  • 2,963
  • 1
  • 20
  • 23
  • This could probably be in a different thread but it's related to your sidenote: Using the "Reply" button puts a card with the text transcript inside the bundle. I wouldn't mind it much other than I can't delete that card. Am I using the right menu item for sending a reply to a card? – Daniel Kaplan Jun 19 '13 at 18:31
  • I don't know either. Added a question about it: http://stackoverflow.com/questions/17218159/can-you-allow-a-user-to-reply-to-a-card-and-not-have-a-card-appear-with-their-re – Mark Scheel Jun 20 '13 at 15:53