Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Latest commit

 

History

History
40 lines (30 loc) · 872 Bytes

README.md

File metadata and controls

40 lines (30 loc) · 872 Bytes

gcm

Build Status Gitter

Google Cloud Messaging (GCM) for D

Usage

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);
	}
}