0

I am working on google drive api, I am using https://github.com/googledrive/android-demos but not getting notification. I am not seeing any notification when I changed metadata of selected file from web. Does anyone succeeded, please provide a link or demo so that a hurdle can be remove.

I have checked similar question Google Drive Android API Change Notifications not working, as I am unable to comment on this question due to less reputation.

APP
  • 445
  • 1
  • 3
  • 16

1 Answers1

0

You can use change listeners to receive notifications whenever a specified file or folder has changes to its contents or metadata.

Based from Google Drive API for Androids on how to listen for change events:

A change listener implements the OnChangeListener interface for the ChangeEvent and receives a direct callback from the Drive service to a currently connected client application.

You can add a change listener by calling the DriveResourceClient.addChangeListener method, passing in the file or folder you want to receive notifications for.

getDriveResourceClient()
        .addChangeListener(file, changeListener)
        .addOnSuccessListener(this, listenerToken -> mChangeListenerToken = listenerToken);
Jessica Rodriguez
  • 2,899
  • 1
  • 12
  • 27
  • I am using , it is having same code which you provided. problem is I am no getting notifications after I am changing file from web. – APP Nov 01 '18 at 06:35