Yi Wang
Yi Wang

Reputation: 552

Notification for new photo/video upload in Google Photo API

I'm working on a digital photo frame app with the new Google Photo Library API beta.

Assume that multiple devices are able to access the same album (shared album, or login with the same account), when there is a picture uploaded from one device, can other devices receive any notification regarding the new upload? If polling is needed for now (that's not really something efficient), what's the recommended interval for polling?

The platforms are Android (TV+Mobile)/iOS/tvOS

Upvotes: 1

Views: 785

Answers (1)

Jan-Felix Schmakeit
Jan-Felix Schmakeit

Reputation: 1106

Right now there's no way to be notified of any changes to the library or albums.

You will need to poll an album (ie. list its contents) or the library to see if any new media has been added. For albums you could also just list the albums and check if the number of media inside it has changed.

The polling interval depends on your use case and how long of a wait is acceptable to your users. For example, you could run a manual refresh in the background every hour if your app isn't open and refresh more frequently when the user is interacting with your app. Maybe you could also include a 'refresh' button to trigger it manually?

Alternatively, if the entire process is handled through your application, you could also send a notification through a different notification service (Firebase Cloud Messaging) to notify your apps and server that a new media item has been added. This is something you'd need to implement yourself though.

This is definitely something that has come up before and I'd encourage you to file a feature request on our public issue tracker: https://developers.google.com/photos/library/support/how-to-get-help#missing-features

Upvotes: 2

Related Questions