Android push notifications from Nextcloud

Howto use Google APIs from PHP: http://stackoverflow.com/questions/22168819/android-test-push-notification-online-google-cloud-messaging

Of course, you first have to activate this Google service: https://console.developers.google.com/projectselector/apis/

Test with Bernd Bindreiter’s open source Android App first: https://play.google.com/store/apps/details?id=com.firstrowria.pushnotificationtester It should always work, even without activation of Google APIs. Source: https://github.com/bbindreiter/PushNotificationTester_App

Since Google is selling more than 1.6 billion Android phones a year, you can reach around 2 billion+ people with Android notification, if they once clicked the “server push” button on Nextcloud web server. No registration in Nextcloud mailing list neccessary any longer.

Finally to implement this is less than a piece of cake, but Nextcloud SQL database structure needs to be extended to keep Android user token and id.

Have fun!

i think that include GCM is a really bad idea for protection of privacy reasons and also you can’t release this on f-droid anymore.

1 Like

Of course, privacy is always a concern. But this feature is just meant to notify Android users, like the “You have new Gmail” in the upper bar. But now its possible to do this from normal web servers, if the Android user once gave his ok.

Including GCM is not an option.
But we want to include notifications like they are on desktop client in the future.
And these then can be shown as android notifications in the upper bar.