/// <summary> /// Application developers override this method to perform actions when the application starts. /// </summary> /// <remarks> /// To be added. /// </remarks> protected override async void OnStart() { // TODO: Logging Console.WriteLine("In On Start"); if (App.Configuration != null) { if (App.Configuration.EnableAutoUpdates) { Distribute.SetEnabledAsync(true).Wait(); Distribute.CheckForUpdate(); } else { Distribute.DisableAutomaticCheckForUpdate(); } Distribute.ReleaseAvailable = this.OnReleaseAvailable; Distribute.UpdateTrack = UpdateTrack.Public; AppCenter.Start("android=10210e06-8a11-422b-b005-14081dc56375;", typeof(Distribute)); } // Handle when your app starts ILoginPresenter loginPresenter = App.Container.Resolve <ILoginPresenter>(); // show the login page await loginPresenter.Start(); }
protected override async void OnResume() { base.OnResume(); SetContentView(Resource.Layout.Main); //InputStream input = Assets.Open("my_asset.txt"); if (!IsTaskRoot) { // Don't start the app again from icon on launcher. Intent intent = Intent; String intentAction = intent.Action; if (intent.HasCategory(Intent.CategoryLauncher) && intentAction != null && intentAction.Equals(Intent.ActionMain)) { Finish(); return; } } AppCenter.Start(Constants.appCenterSecretDroid, typeof(Analytics), typeof(Crashes)); AppCenter.Start(Constants.appCenterSecretDroid, typeof(Distribute)); await Distribute.SetEnabledAsync(true); bool enabled = await Distribute.IsEnabledAsync(); StartTimer(); }
protected async override void OnStart() { await Distribute.SetEnabledAsync(true); // In this example OnReleaseAvailable is a method name in same class Distribute.ReleaseAvailable = OnReleaseAvailable; //AppCenter.LogLevel = LogLevel.Verbose; AppCenter.Start("uwp=0404c586-124c-4b55-8848-910689b6881b;" + "android=31ceef42-fd24-49d3-8e7e-21f144355dde;" + "ios=b80b8476-04cf-4fc3-b7f7-be06ba7f2213", typeof(Analytics), typeof(Crashes), typeof(Distribute)); var _syncManager = Container.Resolve <SyncManager>(); _syncManager.NotifyConnectivityChanged(); try { var _geolocationService = Container.Resolve <GeolocationService>(); await _geolocationService.InitCurrentLocationAsync(); } catch { } switch (Xamarin.Forms.Device.RuntimePlatform) { case Xamarin.Forms.Device.Android: var permission = await DependencyService.Get <IPermission>().VerifyStoragePermissions(); break; } }
protected override void OnStart() { // This should come before AppCenter.Start() is called // Avoid duplicate event registration: if (!AppCenter.Configured) { Push.PushNotificationReceived += (sender, e) => { // Add the notification message and title to the message var summary = $"Push notification received:" + $"\n\tNotification title: {e.Title}" + $"\n\tMessage: {e.Message}"; // If there is custom data associated with the notification, // print the entries if (e.CustomData != null) { summary += "\n\tCustom data:\n"; foreach (var key in e.CustomData.Keys) { summary += $"\t\t{key} : {e.CustomData[key]}\n"; } } // Send the notification summary to debug output System.Diagnostics.Debug.WriteLine(summary); }; } AppCenter.Start("ios=" + AppConstants.AppCenterKeyIos + ";uwp=" + AppConstants.AppCenterKeyUwp + ";android=" + AppConstants.AppCenterKeyDroid, typeof(Analytics), typeof(Crashes), typeof(Push), typeof(Distribute)); #if ENABLE_TEST_CLOUD Analytics.SetEnabledAsync(false); // no analytics from Denmark ;-) Push.SetEnabledAsync(false); // no push during tests Distribute.SetEnabledAsync(false); // no distribution during tests #endif }
protected override void OnStart() { base.OnStart(); AppCenter.Start("ios=9d33b664-e5c5-4237-bb25-afbc50024b6c;" + "android=d1fe6934-15c6-4ec1-88fb-73357451198e;", typeof(Analytics), typeof(Crashes), typeof(Distribute)); Distribute.SetEnabledAsync(true); }
async void UpdateDistributeEnabled(object sender, ToggledEventArgs e) { await Distribute.SetEnabledAsync(e.Value); var acEnabled = await AppCenter.IsEnabledAsync(); RefreshDistributeEnabled(acEnabled); }
protected override void OnStart() { Distribute.ReleaseAvailable = OnReleaseAvailable; //AppCenter.Start("android=6a78412c-8af7-488a-93f9-493e3a1832f0;", typeof(Distribute)); AppCenter.Start("android=969f143f-3ed8-4208-8295-651bdc082202", typeof(Distribute)); //AppCenter.Start("969f143f-3ed8-4208-8295-651bdc082202", typeof(Distribute)); Distribute.SetEnabledAsync(true); }
public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState) { base.OnCreate(savedInstanceState, persistentState); AppCenter.Start("f7ae5016-aa19-4264-8a45-7817bcf7d0e6", typeof(Analytics), typeof(Crashes), typeof(Distribute)); Distribute.SetEnabledAsync(true); //Get locale var lang = Resources.Configuration.Locale; }
static async Task Start(string appSecret) { MobileCenter.Start(appSecret, typeof(Analytics), typeof(Crashes), typeof(Distribute)); #if DEBUG await Distribute.SetEnabledAsync(false); #else await Distribute.SetEnabledAsync(true); #endif await Analytics.SetEnabledAsync(true); }
protected override void OnStart() { new LanguageService().SetLanguage(); // Set device language // Handle when your app starts #if DEBUG #else AppCenter.Start("ios=3d0ef256-3c90-4860-b789-63ff7e930523;" + "android=c1308239-5175-41b4-a352-61530846726e;", typeof(Analytics), typeof(Crashes), typeof(Distribute)); Distribute.SetEnabledAsync(true); #endif }
protected override void OnStart() { base.OnStart(); Distribute.SetEnabledAsync(true); Distribute.ReleaseAvailable = OnReleaseAvailable; AppCenter.LogLevel = LogLevel.Verbose; AppCenter.Start($"ios={Constants.iOSAppCenterKey};android={Constants.AndroidAppCenterKey}", typeof(Analytics), typeof(Crashes), typeof(Distribute)); }
public static async Task Start(string appSecret) { MobileCenter.Start(appSecret, typeof(Analytics), typeof(Crashes), typeof(Distribute), typeof(Push)); #if DEBUG await Distribute.SetEnabledAsync(false); #else await Distribute.SetEnabledAsync(true); #endif await Analytics.SetEnabledAsync(true); var customprops = new CustomProperties(); customprops.Set("username", "mahdi"); MobileCenter.SetCustomProperties(customprops); }
protected override void OnCreate(Bundle savedInstanceState) { // Disable Mobile Center Distribute at runtime Distribute.SetEnabledAsync(false); Distribute.ReleaseAvailable = OnReleaseAvailable; MobileCenter.Start("f8da512a-363f-4c70-9505-b639f0a94f1a", typeof(Distribute)); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.GUIActivity_SplashScreen); timer = new Timer(); timer.Interval = SPLASH_DELAY; timer.Elapsed += Timer_Elapsed; timer.Start(); }
protected override async void OnStart() { base.OnStart(); AppCenter.Start("ios=d7b45b5d-0498-449d-a415-86ce3eb10780;" + "android=646efe20-b1f5-4369-bd06-3eb9743b19e0", typeof(Analytics), typeof(Crashes), typeof(Distribute), typeof(Push)); await Distribute.SetEnabledAsync(true); bool didAppCrashed = await Crashes.HasCrashedInLastSessionAsync(); if (didAppCrashed) { var crashReport = await Crashes.GetLastSessionCrashReportAsync(); } }
protected override void OnStart() { if (Connectivity.NetworkAccess == NetworkAccess.Internet) // { //checkDateTime(); } //Configuracion del App Center AppCenter.Start("android=364e9032-e9db-4d3a-a76f-c2095b3293d1;" + "uwp={Your UWP App secret here};" + "ios={Your iOS App secret here}", typeof(Analytics), typeof(Crashes)); Distribute.SetEnabledAsync(true); //Crear string para la base de datos string dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "dbSCV.db"); //Guardamos el string de la base de datos en una preferencia. Preferences.Set("DB_PATH", dbPath); //Setiamos la Version Preferences.Set("VERSION", "3.0.0.1.1"); //Conectar con la base de datos var db = new SQLiteConnection(dbPath); db.CreateTable <PADRON>(); db.CreateTable <COMPANIAS>(); db.CreateTable <COMPANIASLOC>(); db.CreateTable <PERSONAS>(); db.CreateTable <VW_RESERVA_VISITA>(); db.CreateTable <Invitados>(); db.CreateTable <InvitadosReservas>(); db.CreateTable <SalidaOffline>(); db.CreateTable <PLACA>(); db.CreateTable <DEPTO_LOCALIDAD>(); //Crear los indices de la tabla Task.Factory.StartNew(() => { Debug.WriteLine("Creating indexes"); db.CreateIndex("PADRON", "CEDULA", true); Debug.WriteLine("DONE! creating indexes"); }); ; //Iniciar servicio de subida en el background SetTimer(); }
public static void Start() { AppCenter.LogLevel = LogLevel.Verbose; Distribute.ReleaseAvailable = OnReleaseAvailable; Distribute.SetEnabledAsync(true); Analytics.SetEnabledAsync(true); #if DEBUG Distribute.SetEnabledAsync(false); #endif AppCenter.Start( $"ios={Constants.APPCENTER_IOS_KEY};" + "uwp={Your UWP App secret here};" + $"android={Constants.APPCENTER_DROID_KEY}", typeof(Crashes), typeof(Distribute), typeof(Analytics)); }
protected async override void OnStart() { await Distribute.SetEnabledAsync(true); // In this example OnReleaseAvailable is a method name in same class Distribute.ReleaseAvailable = OnReleaseAvailable; //AppCenter.LogLevel = LogLevel.Verbose; AppCenter.Start("uwp=0404c586-124c-4b55-8848-910689b6881b;" + "android=31ceef42-fd24-49d3-8e7e-21f144355dde;" + "ios=b80b8476-04cf-4fc3-b7f7-be06ba7f2213", typeof(Analytics), typeof(Crashes), typeof(Distribute)); var _syncManager = Container.Resolve <SyncManager>(); _syncManager.NotifyConnectivityChanged(); }
/// <summary> /// Initialize App Center. /// </summary> private static void AppCenterInit() { string initString = "uwp=" + Secret.UWPSecret + ";" + "android=" + Secret.AndroidSecret + ";" + "ios=" + Secret.IOSSecret; Debug.WriteLine(initString, "AppCenterInit"); AppCenter.LogLevel = LogLevel.Verbose; AppCenter.Start(initString, typeof(Analytics), typeof(Crashes), typeof(Distribute)); Distribute.SetEnabledAsync(true); Distribute.CheckForUpdate(); }
async protected override void OnStart() { await Distribute.SetEnabledAsync(false); Distribute.ReleaseAvailable = OnReleaseAvailable; AppCenter.Start($"android={ConfigManager.Instance.AppCenterAndroidToken};ios={ConfigManager.Instance.AppCenteriOSToken}", typeof(Analytics), typeof(Crashes)); CrossConnectivity.Current.ConnectivityChanged += OnConnectivityChanged; if (false) { var l = new AnimationView(); } //Warm up the library base.OnStart(); LoadRegisteredPlayer(); SetMainPage(); EvaluateConnectivity(); WakeUpServer(); }
public static void UpdateAppCenterUpdateChecks(bool inAppUpdateEnabled) => Distribute.SetEnabledAsync(inAppUpdateEnabled);
async void UpdateDistributeEnabled(object sender, ToggledEventArgs e) { await Distribute.SetEnabledAsync(e.Value); }
public async Task CheckUpdates() { await Distribute.SetEnabledAsync(false); await Distribute.SetEnabledAsync(true); }
private async void UpdateDistributeEnabled(object sender, CompoundButton.CheckedChangeEventArgs e) { await Distribute.SetEnabledAsync(e.IsChecked); DistributeEnabledSwitch.Checked = await Distribute.IsEnabledAsync(); }
partial void UpdateEnabled() { Distribute.SetEnabledAsync(DistributeEnabledSwitch.On).Wait(); DistributeEnabledSwitch.On = Distribute.IsEnabledAsync().Result; }