Hi.
The Domoticz Lite app is able to use Google Cloud Messaging (GCM) in order to generate Domoticz notifications on an Android device. To do that, you need to send your GCM ID to Domoticz, which can be done in the Domoticz Lite settings.
Some Domoticz-info about that is needed. I could not find any trace of that being registered in the notification settings of Domoticz.
So..
- How can I check the stored GCM ID in Domoticz?
- How do I remove GCM ID's from there?
- How many can it store there? (I have more than one Android device)
- How to register GCM ID's in Domoticz? (or is this only disclosed to selected devs?)
Some info on Domoticz's GCM handling is greatly appreciated. (or a link to it)
(I'm currently running Domoticz beta version 3.5241 on Raspbian Wheezy on a Raspberry 2)
Google Cloud Messaging works. But how?
Moderators: leecollings, remb0
-
- Posts: 102
- Joined: Thursday 28 January 2016 22:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8153
- Location: NL
- Contact:
-
- Posts: 3
- Joined: Saturday 18 June 2016 21:17
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Google Cloud Messaging works. But how?
Any luck finding more info? It only seems to work if you select "all" for notifications within a Domoticz notification? I cannot find any specific option for sending just to GCM and not the others?
Re: Google Cloud Messaging works. But how?
I'm running the latest beta and I can't get it to work at all with the domoticz-app (not lite). I can see that GCM gets pushed to the server. But no notifications even though I chose all.
-
- Posts: 102
- Joined: Thursday 28 January 2016 22:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8153
- Location: NL
- Contact:
Re: Google Cloud Messaging works. But how?
Well, using GCM with Domoticz seems to be an undocumented feature in Domoticz and the Domoticz Lite developer apparently knows how to use it.
I think, that's unfair. It should be documented and manageable in Domoticz.
My guess is that it's an undocumented JSON call. At least, from my perspective it's undocumented, because I didn't find documentation about it. But I wasn't looking for it for a while, so maybe this has been added to the wiki already.
I think, that's unfair. It should be documented and manageable in Domoticz.
My guess is that it's an undocumented JSON call. At least, from my perspective it's undocumented, because I didn't find documentation about it. But I wasn't looking for it for a while, so maybe this has been added to the wiki already.
Re: Google Cloud Messaging works. But how?
I have limited CPP skills, but this fails (bold):
Json::Reader jReader;
bool ret = jReader.parse(sResult, root);
if (!ret)
{
_log.Log(LOG_ERROR, "GCM: Can not connect to GCM API URL");
return false;
}
bool bSuccess = root["success"].asInt() == 1;
if (!bSuccess)
_log.Log(LOG_ERROR, "Kebab GCM: %s", root["error"].asString().c_str());
_log.Log(LOG_ERROR, "Kebab2 GCM: %s", jReader.getFormattedErrorMessages().c_str());
Those log lines trigger, so I guess the parsing of the JSON is wrong...
Json::Reader jReader;
bool ret = jReader.parse(sResult, root);
if (!ret)
{
_log.Log(LOG_ERROR, "GCM: Can not connect to GCM API URL");
return false;
}
bool bSuccess = root["success"].asInt() == 1;
if (!bSuccess)
_log.Log(LOG_ERROR, "Kebab GCM: %s", root["error"].asString().c_str());
_log.Log(LOG_ERROR, "Kebab2 GCM: %s", jReader.getFormattedErrorMessages().c_str());
Those log lines trigger, so I guess the parsing of the JSON is wrong...
Re: Google Cloud Messaging works. But how?
Some info about the unregister process;
How uninstalled client app unregistration works
A client app can be automatically unregistered after it is uninstalled. However, this process does not happen immediately. What happens in this scenario is:
The end user uninstalls the client app.
The app server sends a message to GCM connection server.
The GCM connection server sends the message to the GCM client on the device.
The GCM client on the device receives the message and detects that the client app has been uninstalled; the detection details depend on the platform on which the client app is running.
The GCM client on the device informs the GCM connection server that the client app was uninstalled.
The GCM connection server marks the registration token for deletion.
The app server sends a message to GCM.
The GCM returns a NotRegistered error message to the app server.
The app server should delete the registration token.
Is there also an option to force this with an unregister button?
How uninstalled client app unregistration works
A client app can be automatically unregistered after it is uninstalled. However, this process does not happen immediately. What happens in this scenario is:
The end user uninstalls the client app.
The app server sends a message to GCM connection server.
The GCM connection server sends the message to the GCM client on the device.
The GCM client on the device receives the message and detects that the client app has been uninstalled; the detection details depend on the platform on which the client app is running.
The GCM client on the device informs the GCM connection server that the client app was uninstalled.
The GCM connection server marks the registration token for deletion.
The app server sends a message to GCM.
The GCM returns a NotRegistered error message to the app server.
The app server should delete the registration token.
Is there also an option to force this with an unregister button?
-
- Posts: 102
- Joined: Thursday 28 January 2016 22:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.8153
- Location: NL
- Contact:
Re: Google Cloud Messaging works. But how?
Newest stable Domoticz version 3.8153 has a mobile devices list, under 'setup - more options'. You can delete devices, there. I like to keep track of the mobile devices, so, thank you, dev team.
You can register new devices by installing the Domoticz app and setup notifications in the app.
You can register new devices by installing the Domoticz app and setup notifications in the app.
Who is online
Users browsing this forum: No registered users and 1 guest