Google Cloud Messaging (GCM) for D
import gcm;
void main()
{
immutable GCM_KEY = ".. key ..";
// simple
{
auto message = gcmessage(["message": "This is a GCM Topic Message!"]);
message.dry_run = true;
auto response = GCM_KEY.sendTopic("/topics/test", message);
assert(response.message_id == -1);
}
// user defined data types
{
static struct CustomData
{
string message;
}
auto message = gcmessage(CustomData("This is a GCM Topic Message!"));
message.dry_run = true;
auto response = GCM_KEY.sendTopic("/topics/test", message);
assert(response.message_id == -1);
}
}