Description

Google Cloud Messaging (GCM) for D

Package Information

Version2.0.0-alpha.2 (2015-Nov-06)
Homepagehttps://github.com/sigod/gcm
Repositoryhttps://github.com/sigod/gcm
LicenseMIT
CopyrightCopyright © 2015, sigod
Authorssigod
Registered bysigod
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

gcm

Build Status Gitter

Google Cloud Messaging (GCM) for D

Usage

import gcm;

void main()
{
	auto gcm = new GCM("api key here");

	// simple
	{
		auto message = gcmessage("/topics/test");
		message.data = ["message": "This is a GCM Topic Message!"];
		message.dry_run = true;
		auto response = gcm.send(message);

		assert(response.message_id == "-1");
	}

	// user defined data types
	{
		static struct CustomData
		{
			string message;
		}

		auto custom_data = CustomData("This is a GCM Topic Message!");

		auto message = gcmessage("/topics/test", custom_data);
		message.dry_run = true;
		auto response = gcm.send(message);

		assert(response.message_id == "-1");
	}
}

Available versions

2.0.0-alpha.2 2.0.0-alpha.1 2.0.0-alpha 1.2.0 1.1.0 1.0.0 ~master