Beispiel #1
0
        internal override void ApplyChanges(IList <string> enabled)
        {
            lock (LOCK) {
                var config = Configuration();

                config
                .Descendants("iosPod")
                .Remove();

                var packages = config.Descendants("iosPods").First();
                foreach (var network in enabled)
                {
                    packages.Add(new XElement(
                                     "iosPod",
                                     new object[] {
                        new XAttribute(
                            "name",
                            "DeltaDNAAds/" + network),
                        new XAttribute(
                            "version",
                            VERSION),
                        new XAttribute(
                            "bitcodeEnabled",
                            "true"),
                        new XAttribute(
                            "minTargetSdk",
                            InitialisationHelper.IosMinTargetVersion()),
                        new XElement("sources", sources)
                    }));
                }

                if (InitialisationHelper.IsDevelopment() && InitialisationHelper.IsDebugNotifications())
                {
                    packages.Add(new XElement(
                                     "iosPod",
                                     new object[] {
                        new XAttribute(
                            "name",
                            "DeltaDNADebug"),
                        new XAttribute(
                            "version",
                            VERSION_DEBUG),
                        new XAttribute(
                            "bitcodeEnabled",
                            "true"),
                        new XAttribute(
                            "minTargetSdk",
                            InitialisationHelper.IosMinTargetVersion()),
                        new XElement("sources", sources)
                    }));
                }

                config.Save(CONFIG);
            }
        }
Beispiel #2
0
        public NetworksWindow() : base()
        {
            networks           = Json.Deserialize(File.ReadAllText(DEFINITIONS)) as IList <object>;
            debugNotifications = InitialisationHelper.IsDebugNotifications();

            foreach (var handler in handlers)
            {
                enabled[handler] = new SortedDictionary <string, bool>();

                var persisted = handler.GetPersisted();
                foreach (IDictionary <string, object> network in networks)
                {
                    var value = network[handler.platform] as string;
                    if (value != null)
                    {
                        enabled[handler][value] = persisted.Contains(value) || false;
                    }
                }
            }
        }
Beispiel #3
0
        internal override void ApplyChanges(IList <string> enabled)
        {
            lock (LOCK) {
                var config = Configuration();

                config
                .Descendants("androidPackage")
                .Remove();

                var packages = config.Descendants("androidPackages").First();
                if (enabled.Count > 0)
                {
                    packages.Add(new XElement(
                                     "androidPackage",
                                     new object[] {
                        new XAttribute(
                            "spec",
                            "com.deltadna.android:deltadna-smartads-core:" + VERSION),
                        new XElement(
                            "repositories",
                            new object[] { new XElement("repository", REPO) })
                    }));
                }
                foreach (var network in enabled)
                {
                    var repos = new List <object>()
                    {
                        new XElement("repository", REPO)
                    };
                    if (network.Equals("hyprmx"))
                    {
                        repos.Add(new XElement(
                                      "repository",
                                      "https://raw.githubusercontent.com/HyprMXMobile/Android-SDKs/master"));
                    }
                    if (network.Equals("mopub"))
                    {
                        repos.Add(new XElement(
                                      "repository",
                                      "https://s3.amazonaws.com/moat-sdk-builds"));
                    }
                    if (network.Equals("tapjoy"))
                    {
                        repos.Add(new XElement(
                                      "repository",
                                      "https://tapjoy.bintray.com/maven"));
                    }

                    packages.Add(new XElement(
                                     "androidPackage",
                                     new object[] {
                        new XAttribute(
                            "spec",
                            "com.deltadna.android:deltadna-smartads-provider-" + network + ":" + VERSION),
                        new XElement(
                            "repositories",
                            repos.ToArray())
                    }));
                }

                if (InitialisationHelper.IsDevelopment() && InitialisationHelper.IsDebugNotifications())
                {
                    packages.Add(new XElement(
                                     "androidPackage",
                                     new object[] {
                        new XAttribute(
                            "spec",
                            "com.deltadna.android:deltadna-smartads-debug:" + VERSION),
                        new XElement(
                            "repositories",
                            new object[] { new XElement("repository", REPO) })
                    }));
                }

                config.Save(CONFIG);
            }

            if (download)
            {
                DownloadLibraries();
            }
        }