使用镜像 API 插入时间线卡,该 API 在捆绑包中具有捆绑包

本文关键字:API 包中具 镜像 插入 时间线 | 更新日期: 2023-09-27 18:33:04

如何在 C#.Net 镜像 API 中使用插入时间线卡,捆绑包内有捆绑包?

在下面的代码中,我正在做的是创建一个捆绑包。我想要的是 item1 和 item2 是不同的捆绑包。可能吗?有解决办法吗?

           TimelineItem item = new TimelineItem()
            {
                Text = controller.Request.Form.Get("message"),
                BundleId = "112",
                IsBundleCover=true,
                Notification = new NotificationConfig() { Level = "DEFAULT" }
            };
            TimelineItem item1 = new TimelineItem()
            {
                Text = "Amalan",
                BundleId = "112",
                Notification = new NotificationConfig() { Level = "DEFAULT" }
            };
            TimelineItem item2 = new TimelineItem()
            {
                Text = "Sanath",
                BundleId = "112",
                Notification = new NotificationConfig() { Level = "DEFAULT" }
            };

使用镜像 API 插入时间线卡,该 API 在捆绑包中具有捆绑包

镜像 API 目前不支持嵌套捆绑包,您可以加注星标以获取有关此区域进度的更新:https://code.google.com/p/google-glass-api/issues/detail?id=167

根据您的使用案例,您还可以尝试通过使用带有内部捆绑包分页的 HTML 卡来解决此问题,但这仅在捆绑包中的卡都具有相同的菜单项时才有效。

因此,与其创建包含几张卡片的捆绑包,不如创建一张卡片,其中将所有卡片的所有内容作为 HTML,然后让它auto-paginate或明确定义单独卡片的内容。有关详细信息和示例,请参阅 https://developers.google.com/glass/timeline#paginating。

然后,您可以将这些分页 HTML 卡中的每一个添加到捆绑包中。