public void Initialize() { if (_Initialized) { return; } _Initialized = true; System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => { var appConfig = new WPCordovaClassLib.CordovaLib.ConfigHandler(); appConfig.LoadAppPackageConfig(); var r1Config = new Config(); r1Config.ApplicationId = appConfig.GetPreference("com.radiumone.r1connect.applicationId"); r1Config.ClientKey = appConfig.GetPreference("com.radiumone.r1connect.clientKey"); r1Config.MPNSServiceName = appConfig.GetPreference("com.radiumone.r1connect.MPNSServiceName"); r1Config.MPNSChannelName = appConfig.GetPreference("com.radiumone.r1connect.MPNSChannelName"); var allowedDomains = appConfig.GetPreference("com.radiumone.r1connect.TileAllowedDomains"); foreach (var allowedDomain in allowedDomains.Split(',')) { try { r1Config.TileAllowedDomains.Add(new Uri(allowedDomain.Trim())); } catch (Exception) { } } #if DEBUG r1Config.InProduction = false; #else r1Config.InProduction = true; #endif var disableAllAdvertisingIds = appConfig.GetPreference("com.radiumone.r1connect.disableAllAdvertisingIds"); if (disableAllAdvertisingIds != null) { disableAllAdvertisingIds = disableAllAdvertisingIds.ToLower(); SDK.Instance.DisableAllAdvertisingIds = (disableAllAdvertisingIds == "true") || (disableAllAdvertisingIds == "yes"); } else { SDK.Instance.DisableAllAdvertisingIds = false; } SDK.Instance.Start(r1Config); RegisterObservers(); }); }
public void Initialize() { if (_Initialized) return; _Initialized = true; System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => { var appConfig = new WPCordovaClassLib.CordovaLib.ConfigHandler(); appConfig.LoadAppPackageConfig(); var r1Config = new Config(); r1Config.ApplicationId = appConfig.GetPreference("com.radiumone.r1connect.applicationId"); r1Config.ClientKey = appConfig.GetPreference("com.radiumone.r1connect.clientKey"); r1Config.MPNSServiceName = appConfig.GetPreference("com.radiumone.r1connect.MPNSServiceName"); r1Config.MPNSChannelName = appConfig.GetPreference("com.radiumone.r1connect.MPNSChannelName"); var allowedDomains = appConfig.GetPreference("com.radiumone.r1connect.TileAllowedDomains"); foreach (var allowedDomain in allowedDomains.Split(',')) { try { r1Config.TileAllowedDomains.Add(new Uri(allowedDomain.Trim())); } catch (Exception) { } } #if DEBUG r1Config.InProduction = false; #else r1Config.InProduction = true; #endif var disableAllAdvertisingIds = appConfig.GetPreference("com.radiumone.r1connect.disableAllAdvertisingIds"); if (disableAllAdvertisingIds != null) { disableAllAdvertisingIds = disableAllAdvertisingIds.ToLower(); SDK.Instance.DisableAllAdvertisingIds = (disableAllAdvertisingIds == "true") || (disableAllAdvertisingIds == "yes"); }else SDK.Instance.DisableAllAdvertisingIds = false; SDK.Instance.Start(r1Config); RegisterObservers(); }); }