Closed galadril closed 5 years ago
Jeej, an milestone! But, great idea! Hopefully someone of the server devs is willing to participate on this.
Nice tutorial/description: https://github.com/codepath/android_guides/wiki/Google-Cloud-Messaging
So the app needs to register on the Google Connection servers, then we need to save that token in Domoticz.
curl -s "https://android.googleapis.com/gcm/send" -H "Authorization: key=[API_KEY_HERE]" -H "Content-Type: application/json" -d '{"to": "[REG_TOKEN_HERE]", "data": {"messages": "text"}}'
Looks not to hard..
Have been worrying about all the api keys being readable (since both Domoticz server and Domoticz Android client are open source) and found this:
http://stackoverflow.com/questions/32827977/can-i-share-google-cloud-messaging-api-key
Or use environment variables in Android Studio for secret things http://en.wikipedia.org/wiki/Environment_variable
If they get the branch, they get a question to setup the environment variable (so they need to create a key for their own..)
I think we should still do that for the Geofence api key :)
Nice find! Going to use this for my other projects to!
As of April 10, 2018, Google has deprecated GCM. The GCM server and client APIs are deprecated and will be removed as soon as April 11, 2019. Migrate GCM apps to Firebase Cloud Messaging (FCM), which inherits the [..] GCM infrastructure. Migration documentation is available.
This is an old repo.. we're using FCM already
Implement Push Notifications from Domoticz system to the Android app! https://developers.google.com/cloud-messaging
This also requires someone to implement Android push notifictions on the Domoticz side...