private IContext MobileContext()
        {
#if UNITY_IOS
            string idfa = Adjust.getIdfa() ?? "unknown_idfa";
#else
            string idfa = "unknown_idfa";
            Adjust.getGoogleAdId((string googleAdId) => {
                idfa = googleAdId;
            });
#endif
            string[] versionInfo   = deviceOS.Split(' ');
            string   versionNumber = versionInfo.Last();
            DebugLog($"Mobile context idfa: {idfa} -> version: {versionNumber}");
            MobileContext context = new MobileContext()
                                    .SetOsType(deviceOS)                //REQUIRED!
                                    .SetOsVersion(versionNumber)        //REQUIRED!
                                    .SetDeviceManufacturer(deviceModel) //REQUIRED!
                                    .SetDeviceModel(deviceModel)        //REQUIRED!
                                    .SetNetworkType(NetworkType.Mobile)
#if UNITY_IOS
                                    .SetAppleIdfa(idfa)
                                    .SetAppleIdfv(Device.vendorIdentifier ?? "Editor")
#else
                                    .SetAndroidIdfa(idfa)
#endif
                                    .Build();
            DebugLog($"MOBILE CONTEXT ({deviceOS}) : {context.GetJson()}");
            return(context);
        }
        public void TestInitFull()
        {
            MobileContext context = new MobileContext()
                                    .SetOsType("iOS")
                                    .SetOsVersion("9.0")
                                    .SetDeviceManufacturer("Apple")
                                    .SetDeviceModel("iPhone 6S+")
                                    .SetCarrier("FREE")
                                    .SetNetworkType(NetworkType.Mobile)
                                    .SetNetworkTechnology("LTE")
                                    .SetOpenIdfa("openidfa")
                                    .SetAppleIdfa("appleidfa")
                                    .SetAppleIdfv("appleidfv")
                                    .SetAndroidIdfa("androididfa")
                                    .Build();

            Assert.NotNull(context);

            Dictionary <string, object> dict = context.GetData();

            Assert.AreEqual(11, dict.Count);
            Assert.AreEqual("iOS", dict [Constants.PLAT_OS_TYPE]);
            Assert.AreEqual("9.0", dict [Constants.PLAT_OS_VERSION]);
            Assert.AreEqual("Apple", dict [Constants.PLAT_DEVICE_MANU]);
            Assert.AreEqual("iPhone 6S+", dict [Constants.PLAT_DEVICE_MODEL]);
            Assert.AreEqual("FREE", dict [Constants.MOBILE_CARRIER]);
            Assert.AreEqual("mobile", dict [Constants.MOBILE_NET_TYPE]);
            Assert.AreEqual("LTE", dict [Constants.MOBILE_NET_TECH]);
            Assert.AreEqual("openidfa", dict [Constants.MOBILE_OPEN_IDFA]);
            Assert.AreEqual("appleidfa", dict [Constants.MOBILE_APPLE_IDFA]);
            Assert.AreEqual("appleidfv", dict [Constants.MOBILE_APPLE_IDFV]);
            Assert.AreEqual("androididfa", dict [Constants.MOBILE_ANDROID_IDFA]);

            Assert.AreEqual("iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-1", context.GetSchema());
            Assert.AreEqual("{\"data\":{\"deviceManufacturer\":\"Apple\", \"appleIdfa\":\"appleidfa\", \"networkTechnology\":\"LTE\", \"appleIdfv\":\"appleidfv\", \"deviceModel\":\"iPhone 6S+\", \"androidIdfa\":\"androididfa\", \"osVersion\":\"9.0\", \"carrier\":\"FREE\", \"osType\":\"iOS\", \"openIdfa\":\"openidfa\", \"networkType\":\"mobile\"}, \"schema\":\"iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-1\"}", context.GetJson().ToString());
        }
        public void TestInitMinimal()
        {
            MobileContext context = new MobileContext().SetOsType("iOS").SetOsVersion("9.0").SetDeviceManufacturer("Apple").SetDeviceModel("iPhone 6S+").Build();

            Assert.NotNull(context);

            Dictionary <string, object> dict = context.GetData();

            Assert.AreEqual(4, dict.Count);
            Assert.AreEqual("iOS", dict [Constants.PLAT_OS_TYPE]);
            Assert.AreEqual("9.0", dict [Constants.PLAT_OS_VERSION]);
            Assert.AreEqual("Apple", dict [Constants.PLAT_DEVICE_MANU]);
            Assert.AreEqual("iPhone 6S+", dict [Constants.PLAT_DEVICE_MODEL]);

            Assert.AreEqual("iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-1", context.GetSchema());
            Assert.AreEqual("{\"data\":{\"osVersion\":\"9.0\", \"deviceManufacturer\":\"Apple\", \"deviceModel\":\"iPhone 6S+\", \"osType\":\"iOS\"}, \"schema\":\"iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-1\"}", context.GetJson().ToString());
        }
        public void testInitMobileContext()
        {
            var mc = new MobileContext()
                     .SetOsType("iOS")
                     .SetOsVersion("8.4")
                     .SetDeviceManufacturer("Apple")
                     .SetDeviceModel("Apple iPhone")
                     .SetCarrier("FREE")
                     .SetNetworkType(NetworkType.Mobile)
                     .SetNetworkTechnology("LTE")
                     .Build();

            Assert.IsNotNull(mc);
            Assert.AreEqual(@"{""schema"":""iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-1"",""data"":{""osType"":""iOS"",""osVersion"":""8.4"",""deviceManufacturer"":""Apple"",""deviceModel"":""Apple iPhone"",""carrier"":""FREE"",""networkType"":""mobile"",""networkTechnology"":""LTE""}}", mc.GetJson().ToString());
        }