I have an Android-based app and I'm developing a Glass app as a companion.
Code for the app lives in two places:
- Web app (OAuth authentication/token creation, creating the subscription, handling the notify callbacks from Google server)
- Android app (creating sharing contact, delete sharing contact and create bundle cover for a "photo album")
After handling all of the OAuth authentication and communicating with the Mirror API, the user has the ability in the Android app to creating a sharing contact. Part of that process includes the creation of a timeline item that serves as the bundle cover for a photo album.
On Glass, as the user shares photos with that contact, the notify handler in my web app assigns the photos to the bundle created when the sharing contact was established.
All of this works fine - no problems there.
What I'm running into is that after 7 days, the timeline cards begin to fall from the Glass interface. This includes my bundle cover for the "photo album".
Obviously I need to update the bundle cover to remain active, but I'm not quite sure how to do that (without quickly ripping through my quota, that is). Using the Mirror API, I've been able to retrieve the items from the timeline, then check each one for my bundle cover (based on bundle ID and isBundleCover flag) - but that is horribly inefficient when it comes to preserving my 1000 requests per day. Am I simply using the bundle in a way that it was not intended for?
Is there an easier, more effective way of fetching the bundle cover and simply updating it so it doesn't fall off the timeline after 7 days? In a way, it seems like I shouldn't need to update the bundle every time a new photo is shared, but I'm not sure about an alternative.
As I mentioned, the bundle is created in the Android app and that ID is submitted to the backend database shared by both the web app and the Android app. Short of querying that db using the bundleID to get the original ItemID for the bundle, I'm not sure how to make the bundle ItemID accessible in the notify handler.
Thank you for any suggestions!