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();
 }
示例#2
0
        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"));
        }
示例#3
0
 public void Test_BuildWithNullRestrictedPackageName()
 {
     GCMMessage.CreateBuilder().WithRestrictedPackageName(null);
 }
示例#4
0
 public void Test_BuildWithNullGCMData()
 {
     GCMMessage.CreateBuilder().WithGCMData(null);
 }
示例#5
0
 public void Test_BuildWithNullCollapseKey()
 {
     GCMMessage.CreateBuilder().WithCollapseKey(null);
 }