I'm using the C# libraries to send a bundle. Right now, I'm sending multiple requests which causes Glass to ding several times as the cards come in. I would like to batch these requests like in the question (link below) that was answered for Java Mirror API libraries. I can't find an equivalent solution in the C# libraries. Here's the original question for Java How do I send bundled cards all at the same time?
Here's my current code
TimelineItem bundleCover = Utils.GetBundleCard(bundleId);
Stream stream = null;
if (!String.IsNullOrEmpty(Config.BUNDLE_MEDIA_LINK))
{
if (Config.BUNDLE_MEDIA_LINK.StartsWith("/"))
{
stream = new StreamReader(Server.MapPath(Config.BUNDLE_MEDIA_LINK)).BaseStream;
}
else
{
HttpWebRequest request = WebRequest.Create(Config.BUNDLE_MEDIA_LINK) as HttpWebRequest;
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
stream = response.GetResponseStream();
}
}
List<TimelineItem> timelineItems = Utils.GetSlideCards(presentation, bundleId);
foreach (TimelineItem tli in timelineItems)
{
Service.Timeline.Insert(tli).Fetch();
}
// Send the bundle and attachment last
Service.Timeline.Insert(bundleCover, stream, "image/jpeg").Upload();
Any help would be greatly appreciated.