protected override void OnStart() { MobileCenter.Start("android=c53edf74-42e6-45b9-aea2-e35081876ab4;" + "uwp=4d91dbed-b7cd-4473-bb0d-8aeb8455561f;" + "ios=292f90a8-cf19-45bd-a07b-a299823732b1", typeof(Analytics), typeof(Crashes), typeof(Push)); }
protected override void OnStart() { // Handle when your app starts MobileCenter.Start($"android={Common.MobileCenterConstants.AndroidAppId};" + $"ios={Common.MobileCenterConstants.iOSAppId}", typeof(Analytics), typeof(Crashes)); }
public void StartInstanceTwiceTogether() { MobileCenter.Configure("appsecret"); MobileCenter.Start(typeof(MockMobileCenterService), typeof(MockMobileCenterService)); MockMobileCenterService.Instance.MockInstance.Verify( service => service.OnChannelGroupReady(It.IsAny <ChannelGroup>(), It.IsAny <string>()), Times.Once()); }
protected override void OnCreate(Bundle bundle) { FirebaseApp.InitializeApp(ApplicationContext); MobileCenter.LogLevel = LogLevel.Verbose; Push.Enabled = true; MobileCenter.Start("7462b81e-72c5-4272-bf9c-2a62c4a16f84", typeof(Analytics), typeof(Crashes), typeof(Distribute), typeof(Push)); var installid = MobileCenter.InstallId; 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); }; // 绑定 Click 事件 Analytics.TrackEvent("Click"); // Set our view from the "main" layout resource // SetContentView (Resource.Layout.Main); base.OnCreate(bundle); // 加载布局 SetContentView(Resource.Layout.Main); // 获取布局中的控件 Button say = FindViewById <Button>(Resource.Id.sayHello); TextView show = FindViewById <TextView>(Resource.Id.showHello); say.Click += (sender, e) => { count++; show.Text = "Hello, Android"; say.Text = $"You Clicked {count}"; if (count > 5) { Crashes.Enabled = true; //throw new System.Exception("error:click>5"); Crashes.GenerateTestCrash(); } // Toast 通知 Toast.MakeText(this, $"You Clicked {count}", ToastLength.Short).Show(); }; }
public static void Run() { CrossVersionTracking.Current.Track(); // Crashes.GetErrorAttachment = (report) => ErrorAttachment.AttachmentWithText (CrossVersionTracking.Current.ToString ()); #if __IOS__ Microsoft.Azure.Mobile.Distribute.Distribute.DontCheckForUpdatesInDebug(); #endif if (!string.IsNullOrEmpty(PrivateKeys.MobileCenter.AppSecret)) { MobileCenter.Start(PrivateKeys.MobileCenter.AppSecret, typeof(Microsoft.Azure.Mobile.Analytics.Analytics), typeof(Microsoft.Azure.Mobile.Crashes.Crashes), typeof(Microsoft.Azure.Mobile.Distribute.Distribute), typeof(Microsoft.Azure.Mobile.Push.Push)); } PclExportClient.Configure(); // JsonHttpClient.GlobalHttpMessageHandlerFactory = () => new NativeMessageHandler (); Settings.RegisterDefaultSettings(); Settings.SetUomDefaults(CrossVersionTracking.Current.IsFirstLaunchEver); //Settings.UserReferenceKey = MobileCenter.InstallId?.ToString ("N"); #if __ANDROID__ Settings.VersionNumber = CrossVersionTracking.Current.CurrentVersion; Settings.BuildNumber = CrossVersionTracking.Current.CurrentBuild; Settings.RandomBackgrounds |= CrossVersionTracking.Current.IsFirstLaunchEver; #endif }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it var button = FindViewById <Button>(Resource.Id.MyButton); button.Click += delegate { // Crash button.Text = button.Text.Substring(42); }; // Mobile Center integration MobileCenterLog.Assert(LogTag, "MobileCenter.LogLevel=" + MobileCenter.LogLevel); MobileCenter.LogLevel = LogLevel.Verbose; MobileCenterLog.Info(LogTag, "MobileCenter.LogLevel=" + MobileCenter.LogLevel); MobileCenter.Start("44cd8722-bfe0-4748-ac14-7692e031a8a5", typeof(Analytics), typeof(Crashes)); Analytics.TrackEvent("myEvent", new Dictionary <string, string> { { "someKey", "someValue" } }); MobileCenterLog.Info(LogTag, "MobileCenter.InstallId=" + MobileCenter.InstallId); MobileCenterLog.Info(LogTag, "MobileCenter.HasCrashedInLastSession=" + Crashes.HasCrashedInLastSession); MobileCenterLog.Info(LogTag, "MobileCenter.LastSessionCrashReport=" + Crashes.LastSessionCrashReport?.AndroidDetails?.Throwable); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method MobileCenter.Start("679cde85-80f8-4df5-9524-a44354ee7410", typeof(Analytics), typeof(Crashes)); return(true); }
protected override void OnStart() { MobileCenter.Start("uwp=21242859-6c7c-41ce-babe-6228c4a892ba;android=8c4dc2a1-4536-4e4a-aeb4-7a86e121ea5b;ios=f467fb1e-f56f-4e99-a70b-127da06e639b;", typeof(Analytics), typeof(Crashes), typeof(Push)); //Debug.WriteLine("OnStart"); //// always re-set when the app starts //// users expect this (usually) //// Properties ["ResumeAtTodoId"] = ""; //if (Properties.ContainsKey("ResumeAtTodoId")) //{ // var rati = Properties["ResumeAtTodoId"].ToString(); // Debug.WriteLine(" rati=" + rati); // if (!String.IsNullOrEmpty(rati)) // { // Debug.WriteLine(" rati=" + rati); // ResumeAtTodoId = int.Parse(rati); // if (ResumeAtTodoId >= 0) // { // var todoPage = new TodoItemPage(); // todoPage.BindingContext = await Database.GetItemAsync(ResumeAtTodoId); // await MainPage.Navigation.PushAsync(todoPage, false); // no animation // } // } //} }
public static void Run() { CrossVersionTracking.Current.Track(); Settings.RegisterDefaultSettings(); #if __MOBILE__ // Crashes.GetErrorAttachment = (report) => ErrorAttachment.AttachmentWithText (CrossVersionTracking.Current.ToString ()); if (!string.IsNullOrEmpty(Keys.MobileCenter.AppSecret)) { MobileCenter.Start(Keys.MobileCenter.AppSecret, typeof(Analytics), typeof(Crashes)); Settings.UserReferenceKey = MobileCenter.InstallId?.ToString("N") ?? "anonymous"; } #if __ANDROID__ Settings.VersionNumber = CrossVersionTracking.Current.CurrentVersion; Settings.BuildNumber = CrossVersionTracking.Current.CurrentBuild; #endif //InitializeDataStore (); //Task.Run (async () => //{ // var blobs = await AzureStorageClient.Shared.ListPublicBlobsAsync (); // foreach (var blob in blobs) // { // System.Diagnostics.Debug.WriteLine ($"{blob}"); // } //}); #endif }
public App() { InitializeComponent(); MainPage = new MobileCenterTest.MainPage(); MobileCenter.Start(typeof(Analytics), typeof(Crashes)); }
public App() { InitializeComponent(); MobileCenter.Start($"android={Constants.MobileCenterAndroid};" + $"uwp={Constants.MobileCenterUWP};" + $"ios={Constants.MobileCenteriOS}", typeof(Analytics), typeof(Crashes)); if (UseMockDataStore) { DependencyService.Register <MockDataStore>(); } else { DependencyService.Register <CloudDataStore>(); } //Only show the settings screen initially if the user has not previously provided an email if (!string.IsNullOrWhiteSpace(Settings.Email)) { MainPage = new NavigationPage(new UpcomingProgramsPage()); } else { MainPage = new NavigationPage(new LoginPage()); } }
protected override void OnStart() { // Handle when your app starts MobileCenter.Start("android=17e8ed2d-61fa-407c-8e58-99e50e650e5e;" + "ios=492c51ef-2049-455f-bc82-1f4fe6b0cba5;", typeof(Analytics), typeof(Crashes)); }
protected override void OnStart() { // Handle when your app starts MobileCenter.Start("android=5ef74552-8ea7-4388-9a74-426d4078030d;" + "ios={Your iOS App secret here}", typeof(Analytics), typeof(Crashes)); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); global::Xamarin.Auth.Presenters.XamarinAndroid.AuthenticationConfiguration.Init(this, bundle); global::Xamarin.Auth.CustomTabsConfiguration.ActionLabel = null; global::Xamarin.Auth.CustomTabsConfiguration.MenuItemTitle = null; global::Xamarin.Auth.CustomTabsConfiguration.AreAnimationsUsed = true; global::Xamarin.Auth.CustomTabsConfiguration.IsShowTitleUsed = false; global::Xamarin.Auth.CustomTabsConfiguration.IsUrlBarHidingUsed = false; global::Xamarin.Auth.CustomTabsConfiguration.IsCloseButtonIconUsed = false; global::Xamarin.Auth.CustomTabsConfiguration.IsActionButtonUsed = false; global::Xamarin.Auth.CustomTabsConfiguration.IsActionBarToolbarIconUsed = false; global::Xamarin.Auth.CustomTabsConfiguration.IsDefaultShareMenuItemUsed = false; global::Android.Graphics.Color color_xamarin_blue; color_xamarin_blue = new global::Android.Graphics.Color(0x34, 0x98, 0xdb); global::Xamarin.Auth.CustomTabsConfiguration.ToolbarColor = color_xamarin_blue; MobileCenter.Start("b24cccf0-0f70-42cd-b94e-a6c61dbe9add", typeof(Analytics), typeof(Crashes)); LoadApplication(new App()); }
public App() { InitializeComponent(); MobileCenter.Start(typeof(Analytics), typeof(Crashes)); MainPage = new ContentPage() { Content = new StackLayout() { Padding = new Thickness(40), Children = { new Label { Text = "This is a simple application designed to track user location every fifteen minutes. You're not required to do anything here :)", FontSize = 20, FontAttributes = FontAttributes.Bold, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions = LayoutOptions.CenterAndExpand } } } }; }
/// <summary> /// Setup the telemetry providers /// </summary> private TelemetryService() { try { // Setup Google Analytics AnalyticsManager.Current.DispatchPeriod = TimeSpan.Zero; // Immediate mode, sends hits immediately AnalyticsManager.Current.AutoAppLifetimeMonitoring = true; // Handle suspend/resume and empty hit batched hits on suspend AnalyticsManager.Current.AppOptOut = false; AnalyticsManager.Current.IsEnabled = true; AnalyticsManager.Current.IsDebug = false; GoogleAnalyticsClient = AnalyticsManager.Current.CreateTracker(ApiKeyService.GoogleAnalyticsTrackerId); // Azure Mobile Aalytics and push support MobileCenter.Start(ApiKeyService.AzureMobileCenterClientId, typeof(Analytics), typeof(Push)); // Used for crash reporting HockeyClient.Current.Configure(ApiKeyService.HockeyAppClientId); #if DEBUG // Disable this on debug AnalyticsManager.Current.AppOptOut = true; AnalyticsManager.Current.IsDebug = true; AsyncHelper.RunSync(async() => { await MobileCenter.SetEnabledAsync(false); }); #endif } catch { // ignored } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); MobileCenter.Start("ec83ff43-c267-4e8c-8848-db08562f9f04", typeof(Analytics), typeof(Crashes)); adapter = new TabsAdapter(this, SupportFragmentManager); pager = FindViewById <ViewPager>(Resource.Id.viewpager); var tabs = FindViewById <TabLayout>(Resource.Id.tabs); pager.Adapter = adapter; tabs.SetupWithViewPager(pager); pager.OffscreenPageLimit = 3; pager.PageSelected += (sender, args) => { var fragment = adapter.InstantiateItem(pager, args.Position) as IFragmentVisible; fragment?.BecameVisible(); }; Toolbar.MenuItemClick += (sender, e) => { var intent = new Intent(this, typeof(AddItemActivity));; StartActivity(intent); }; SupportActionBar.SetDisplayHomeAsUpEnabled(false); SupportActionBar.SetHomeButtonEnabled(false); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Distribute.ReleaseAvailable = OnReleaseAvailable; MobileCenter.Start("8d6a239d-6428-4725-a02b-6028645a8560", typeof(Analytics), typeof(Crashes), typeof(Distribute)); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button button = FindViewById <Button>(Resource.Id.myButton); Button myTestButton = FindViewById <Button>(Resource.Id.myTestButton); button.Click += delegate { Analytics.TrackEvent("Button Click"); button.Text = $"{count++} clicks!"; if (count == 8) { throw new NotImplementedException(); } }; myTestButton.Click += delegate { Analytics.TrackEvent("Test Button Click", new Dictionary <string, string> { ["Event Name"] = "Button Click For New Changes", ["Button Name"] = myTestButton.Text, ["Button Height"] = myTestButton.Height.ToString() }); }; }
public static void Run() { CrossVersionTracking.Current.Track(); Log.Debug($"\n{CrossVersionTracking.Current}"); Settings.RegisterDefaultSettings(); // don't delete - this api should return soon // Crashes.GetErrorAttachment = (report) => ErrorAttachment.AttachmentWithText (CrossVersionTracking.Current.ToString ()); #if __IOS__ Microsoft.Azure.Mobile.Distribute.Distribute.DontCheckForUpdatesInDebug(); #elif __ANDROID__ Settings.VersionNumber = CrossVersionTracking.Current.CurrentVersion; Settings.BuildNumber = CrossVersionTracking.Current.CurrentBuild; #endif if (!string.IsNullOrEmpty(Keys.MobileCenter.AppSecret)) { Log.Debug("Starting Mobile Center..."); MobileCenter.Start(Keys.MobileCenter.AppSecret, typeof(Microsoft.Azure.Mobile.Analytics.Analytics), typeof(Microsoft.Azure.Mobile.Crashes.Crashes), typeof(Microsoft.Azure.Mobile.Distribute.Distribute)); } else { Log.Debug("To use Mobile Center, add your App Secret to Keys.MobileCenter.AppSecret"); } Settings.UserReferenceKey = MobileCenter.InstallId?.ToString("N"); }
public App() { MobileCenter.Start("android=a144ccbc-67d1-4d64-a5bd-c7dffa8fec0b;" + "uwp={Your UWP App secret here};" + "ios=fb89d881-69c7-4a8a-af97-e7e6924db00f", typeof(Analytics), typeof(Crashes)); InitializeComponent(); //SetMainPage(); //GetLoginPage(loginManager); ILoginManager ilm = loginManager; if (!IsUserLoggedIn) { //NavigationPage.SetHasNavigationBar(page, false); //MainPage = new NavigationPage(new LoginPage(ilm)); var page = new LoginPage(ilm); NavigationPage.SetHasNavigationBar(page, false); // call this method every time before you push a page (no title bar) MainPage = new NavigationPage(page); } else { //MainPage = new NavigationPage(new RUThereYet.MainPage()); } }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method MobileCenter.Start("ad0f1af0-47b1-4bbc-96b1-47a2065c5bcf", typeof(Analytics), typeof(Crashes)); return(true); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Push.Enabled = true; // This should come before MobileCenter.Start() is called 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); }; // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); MobileCenter.Start("c9e67f6d-f96b-41d2-9628-e7a2b96dea66", typeof(Analytics), typeof(Crashes), typeof(Push)); }
public void CrashesSetsCorrelationId() { MobileCenter.Start("secret", typeof(Crashes.Crashes)); #pragma warning disable CS0612 // Type or member is obsolete Assert.IsNotNull(MobileCenter.Instance.InstanceCorrelationId); #pragma warning restore CS0612 // Type or member is obsolete }
protected override void OnStart() { MobileCenterLog.Assert(LogTag, "MobileCenter.LogLevel=" + MobileCenter.LogLevel); MobileCenter.LogLevel = LogLevel.Verbose; MobileCenterLog.Info(LogTag, "MobileCenter.LogLevel=" + MobileCenter.LogLevel); MobileCenterLog.Info(LogTag, "MobileCenter.Configured=" + MobileCenter.Configured); //set event handlers Crashes.SendingErrorReport += SendingErrorReportHandler; Crashes.SentErrorReport += SentErrorReportHandler; Crashes.FailedToSendErrorReport += FailedToSendErrorReportHandler; //set callbacks Crashes.ShouldProcessErrorReport = ShouldProcess; Crashes.ShouldAwaitUserConfirmation = ConfirmationHandler; MobileCenterLog.Assert(LogTag, "MobileCenter.Configured=" + MobileCenter.Configured); MobileCenterLog.Assert(LogTag, "MobileCenter.InstallId (before configure)=" + MobileCenter.InstallId); MobileCenter.SetLogUrl("https://in-integration.dev.avalanch.es"); MobileCenter.Start("android=bff0949b-7970-439d-9745-92cdc59b10fe;ios=b889c4f2-9ac2-4e2e-ae16-dae54f2c5899", typeof(Analytics), typeof(Crashes)); Analytics.TrackEvent("myEvent"); Analytics.TrackEvent("myEvent2", new Dictionary <string, string> { { "someKey", "someValue" } }); MobileCenterLog.Info(LogTag, "MobileCenter.InstallId=" + MobileCenter.InstallId); MobileCenterLog.Info(LogTag, "Crashes.HasCrashedInLastSession=" + Crashes.HasCrashedInLastSession); Crashes.GetLastSessionCrashReportAsync().ContinueWith(report => { MobileCenterLog.Info(LogTag, " Crashes.LastSessionCrashReport.Exception=" + report.Result?.Exception); }); }
public App() { InitializeComponent(); PCA = new PublicClientApplication(ClientID, Authority); PCA.RedirectUri = $"msal{ClientID}://auth"; #if !DEBUG MobileCenter.Start($"android={Constants.MobileCenterAndroid};" + $"uwp={Constants.MobileCenterUWP};" + $"ios={Constants.MobileCenteriOS}", typeof(Analytics), typeof(Crashes)); #endif ApiClient = new HttpClient(); ApiClient.BaseAddress = new Uri($"{BackendUrl}/"); if (UseMockDataStore) { DependencyService.Register <MockDataStore>(); } else { DependencyService.Register <CloudDataStore>(); } if (Xamarin.Forms.Device.RuntimePlatform == Xamarin.Forms.Device.iOS) { MainPage = new MainPage(); } else { MainPage = new NavigationPage(new MainPage()); } }
public App() { InitializeComponent(); MobileCenter.Start(typeof(Analytics), typeof(Crashes)); MainPage = new WayFinder.WayFinderMaps(); //DependencyService.Get<ISMSSender>().Send("918149910989", "Test"); }
public void StartWrongInstanceTypeServiceAndCorrectService() { MobileCenter.Start("app secret", typeof(WrongInstanceTypeMobileCenterService), typeof(MockMobileCenterService)); MockMobileCenterService.Instance.MockInstance.Verify( service => service.OnChannelGroupReady(It.IsAny <ChannelGroup>(), It.IsAny <string>()), Times.Once()); }
public App() { // The root page of your application //MainPage = new TodoList(); MainPage = new NavigationPage(new LoginPage()); MobileCenter.Start(typeof(Analytics), typeof(Crashes)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it var button = FindViewById <Button>(Resource.Id.MyButton); button.Click += delegate { // Crash button.Text = button.Text.Substring(42); }; // Mobile Center integration MobileCenterLog.Assert(LogTag, "MobileCenter.LogLevel=" + MobileCenter.LogLevel); MobileCenter.LogLevel = LogLevel.Verbose; MobileCenterLog.Info(LogTag, "MobileCenter.LogLevel=" + MobileCenter.LogLevel); MobileCenter.SetLogUrl("https://in-integration.dev.avalanch.es"); MobileCenter.Start("bff0949b-7970-439d-9745-92cdc59b10fe", typeof(Analytics), typeof(Crashes)); Analytics.TrackEvent("myEvent", new Dictionary <string, string> { { "someKey", "someValue" } }); MobileCenterLog.Info(LogTag, "MobileCenter.InstallId=" + MobileCenter.InstallId); MobileCenterLog.Info(LogTag, "MobileCenter.HasCrashedInLastSession=" + Crashes.HasCrashedInLastSession); Crashes.GetLastSessionCrashReportAsync().ContinueWith(report => { MobileCenterLog.Info(LogTag, "MobileCenter.LastSessionCrashReport=" + report.Result?.AndroidDetails?.Throwable); }); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method MobileCenter.Start("cd293ebb-d4ee-46aa-9974-04bae163b6db", typeof(Analytics), typeof(Crashes)); UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, true); UINavigationBar.Appearance.BarTintColor = UIColor.White; UINavigationBar.Appearance.TintColor = UIColor.White; UINavigationBar.Appearance.ShadowImage = null; // create a new window instance based on the screen size Window = new UIWindow(UIScreen.MainScreen.Bounds); // Add the Navigation Controller and initialize it var navController = new UINavigationController(new SplashViewController()); Window.RootViewController = navController; ////// set our root view controller with the sidebar menu as the apps root view controller //Window.RootViewController = RootViewController; Reachability.RemoteHostStatus(); return(true); }