internal Builder(KiiPushMessageData messageData) { this.mParent = new JsonObject(); this.mMessageData = messageData; this.mGcm = GCMMessage.CreateBuilder().Build().ToJson(); this.mApns = APNSMessage.CreateBuilder().Build().ToJson(); this.mMqtt = MqttMessage.CreateBuilder().Build().ToJson(); }
public void Test_0005_GCMMessage() { GCMData data = new GCMData(); data.Put("payload", "abc"); GCMMessage apns = GCMMessage.CreateBuilder() .WithGCMData(data) .WithCollapseKey("CollapseKey") .WithDelayWhileIdle(true) .WithRestrictedPackageName("RestrictedPackageName") .WithTimeToLive(4) .Build(); JsonObject json = apns.ToJson(); Assert.AreEqual(true, json.Get("enabled")); Assert.AreEqual("CollapseKey", json.Get("collapseKey")); Assert.AreEqual(true, json.Get("delayWhileIdle")); Assert.AreEqual(4, json.Get("timeToLive")); Assert.AreEqual("RestrictedPackageName", json.Get("restrictedPackageName")); Assert.AreEqual("abc", json.GetJsonObject("data").Get("payload")); }
public void Test_BuildWithNullRestrictedPackageName() { GCMMessage.CreateBuilder().WithRestrictedPackageName(null); }
public void Test_BuildWithNullGCMData() { GCMMessage.CreateBuilder().WithGCMData(null); }
public void Test_BuildWithNullCollapseKey() { GCMMessage.CreateBuilder().WithCollapseKey(null); }