Receive Drive content notifications in an Android app without a backend

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Receive Drive content notifications in an Android app without a backend



I have to use Google Drive REST API due to the limitation of Android Drive API for my android app. Everything works properly until registering for change notification. From the API docs, the workflow is:


example.com


https://example.com/notifications



Is it possible to receive push notification from Google Drive on an android app without my own backend server?





you'll need an http server running on your phone. There is code on Github that will allow you to embed the server in your app. Dynamic DNS will handle the routing. However, a simple backend to convert the notifications to Firebase Cloud Messaging would probably be simpler.
– pinoyyid
Aug 11 at 9:30





@pinoyyid thanks for the solution, but if so, my app only receives notification when running that is not practical
– thanhbinh84
Aug 11 at 9:52





Well you could run it as a Service, but nevertheless I agree which is why I steered you towards a simple FCM server.
– pinoyyid
Aug 11 at 10:08




1 Answer
1



you'd have define that push notification URL as a Cloud Function HTTP Trigger's URL - which then pushes a Firebase Cloud Messaging notification to an Android client, whenever it is being triggered.
basically, this would be a HTTP push notification sending out a subsequent FCM push notification.





sound complicated, do you have kind of tutorial for this, I am not familiar with backend stuff
– thanhbinh84
Aug 13 at 3:08





@thanhbinh84 have linked some of the documentation, while it obviously would need that one Cloud Function scripted. the GSuite Admin SDK is not even useful here, because one can only pull this information; updated my answer to the least required.
– Martin Zeitler
Aug 13 at 3:27






@thanhbinh84 here would be one relevant tutorial: android.jlelse.eu/… while for Drive, one needs an HTTP trigger, instead of changes to a Firebase database, in order to know when to run the cloud function.
– Martin Zeitler
Aug 13 at 3:39







By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard