public void Notify(Exception e, ErrorSeverity severity = ErrorSeverity.Error, Metadata extraMetadata = null) { var extraData = new Dictionary <string, string> (); foreach (var item in extraMetadata) { if (item.Value != null) { var data = item.Value.ToObject <Dictionary <string, string> >(); foreach (var i in data) { extraData.Add(item.Key + ":" + i.Key, i.Value); } } } if (severity == ErrorSeverity.Info) { Insights.Track("Info", extraData); } else { var reportSeverity = severity == ErrorSeverity.Warning ? Insights.Severity.Warning : Insights.Severity.Error; Insights.Report(e, extraData, reportSeverity); } }
public void Log(string message, Song song, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { try { Console.WriteLine(message); var dictionary = new Dictionary <string, string>() { { "Song ID", song?.Id ?? "NULL" }, { "Song Title", song?.Name ?? "NULL" }, { "Song Types", song?.MediaTypesString ?? "NULL" }, { "Song Service Types", song?.ServiceTypesString ?? "NULL" }, { "Song Offline Count", song?.OfflineCount.ToString() ?? "NULL" }, { "Method", memberName }, { "File", sourceFilePath }, { "Line number", sourceLineNumber.ToString() }, }; Task.Run(() => Insights.Track(message, dictionary)); } catch (Exception ex) { Console.WriteLine(ex); } }
public void Log(string message, Track track, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { try { var dictionary = new Dictionary <string, string>() { { "Track Id", track?.Id ?? "NULL" }, { "Song ID", track?.SongId ?? "NULL" }, { "Song type", track.ServiceExtra2 }, { "File Extension", track?.FileExtension ?? "NULL" }, { "Media Type", track?.MediaType.ToString() ?? "NULL" }, { "Service Type", track?.ServiceType.ToString() ?? "NULL" }, { "Method", memberName }, { "File", sourceFilePath }, { "Line number", sourceLineNumber.ToString() }, }; Task.Run(() => Insights.Track(message, dictionary)); } catch (Exception ex) { Console.WriteLine(ex); } }
public ListViewPage() { Title = "List View Page"; var listViewData = SampleDataModelFactory.GetSampleData(); var cell = new DataTemplate(typeof(WhiteTextImageCell)); cell.SetValue(TextCell.TextProperty, "Number"); cell.SetBinding(ImageCell.DetailProperty, "Number"); cell.SetValue(ImageCell.ImageSourceProperty, "Hash"); var listView = new ListView { ItemTemplate = cell, ItemsSource = listViewData, BackgroundColor = Color.FromHex("#2980b9") }; listView.ItemTapped += (s, e) => { var item = e.Item; Insights.Track(Insights_Constants.LIST_VIEW_ITEM_TAPPED, Insights_Constants.LIST_VIEW_ITEM_NUMBER, item.ToString()); DisplayAlert("Number Tapped", $"You Selected Number {item.ToString()}", "OK"); }; Content = listView; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); // Code for starting up the Xamarin Test Cloud Agent #if ENABLE_TEST_CLOUD Xamarin.Calabash.Start(); #endif Insights.Initialize("4cdef01b1dc979920d5d485896d5fe50e9c752a6"); Insights.Track("iOS/Start"); Ubertesters.Shared.InitializeWithOptions(UbertestersOptions.ActivationModeWidget | UbertestersOptions.LockingModeDisableUbertesters); AppDomain.CurrentDomain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) => { CrashHandler.PostCrash(e); }; App.Version = GetBuildNumber(); App.ClipboardService = new ClipboardService(); LoadApplication(new App()); UIApplication.SharedApplication.IdleTimerDisabled = true; return(base.FinishedLaunching(app, options)); }
/// <summary> /// Builds the page. /// </summary> /// <returns>The page.</returns> /// <param name="item">Item.</param> public TabbedPage BuildPage(T item) { if (item == null) { return(new TabbedPage { Title = "Not Found", Children = { new PhoenixPage("Not Found") { Content = new StackLayout{ VerticalOptions = LayoutOptions.CenterAndExpand, Children = { new Label { Text = "These aren't the droids you are looking for", HorizontalOptions = LayoutOptions.CenterAndExpand } } } } } }); } Insights.Track(item.GetType().ToString()); entityPage = new EntityContentPage(item); DisplayEntity(item); return(entityPage); }
public async void PlaySong(QueueSong song) { if (song == null || song.Song == null) { CurtainPrompt.ShowError("Song seems to be empty..."); return; } Insights.Track( "Play Song", new Dictionary <string, string> { { "Name", song.Song.Name }, { "ArtistName", song.Song.ArtistName }, { "ProviderId", song.Song.ProviderId } }); if (_isShutdown) { await AddMediaPlayerEventHandlers(); } _appSettings.Write("RadioId", null); _appSettings.Write("RadioMode", false); _appSettings.Write(PlayerConstants.CurrentTrack, song.Id); var message = new ValueSet { { PlayerConstants.StartPlayback, null } }; BackgroundMediaPlayer.SendMessageToBackground(message); RaiseEvent(TrackChanged); }
protected async override void OnAppearing() { base.OnAppearing(); // fetch the demo credentials await ViewModel.LoadDemoCredentials(); // pause for a moment before animations await Task.Delay(App.AnimationSpeed); // Sequentially animate the login buttons. ScaleTo() makes them "grow" from a singularity to the full button size. await SignInButton.ScaleTo(1, (uint)App.AnimationSpeed, Easing.SinIn); await SkipSignInButton.ScaleTo(1, (uint)App.AnimationSpeed, Easing.SinIn); // Using Task.WhenAll() allows these two animations to be run in parallel. await Task.WhenAll(new [] { // FadeTo() modifies the Opacity property of the given VisualElements over a given duration. XamarinLogo.FadeTo(1, (uint)App.AnimationSpeed, Easing.SinIn), InfoButton.FadeTo(1, (uint)App.AnimationSpeed, Easing.SinIn) }); Insights.Track(InsightsReportingConstants.PAGE_SPLASH); }
public void Track(string identifier, IDictionary <string, string> extraData = null) { if (Insights.IsInitialized) { Insights.Track(identifier, extraData); } }
void ExecuteResetButtonPressed() { Insights.Track(InsightsConstants.ResetButtonTapped); SetRandomEmotion(); Photo1ImageSource = null; Photo2ImageSource = null; IsTakeLeftPhotoButtonEnabled = true; IsTakeLeftPhotoButtonStackVisible = true; IsTakeRightPhotoButtonEnabled = true; IsTakeRightPhotoButtonStackVisible = true; ScoreButton1Text = null; ScoreButton2Text = null; IsScore1ButtonEnabled = false; IsScore2ButtonEnabled = false; IsScore1ButtonVisable = false; IsScore2ButtonVisable = false; _photo1Results = null; _photo2Results = null; IsPhotoImage1Enabled = false; IsPhotoImage2Enabled = false; }
private async Task ReviewReminderAsync() { var launchCount = Locator.AppSettingsHelper.Read <int>("LaunchCount"); Locator.AppSettingsHelper.Write("LaunchCount", ++launchCount); if (launchCount != 5) { return; } var rate = "FeedbackDialogRateButton".FromLanguageResource(); var md = new MessageDialog( "FeedbackDialogContent".FromLanguageResource(), "FeedbackDialogTitle".FromLanguageResource()); md.Commands.Add(new UICommand(rate)); md.Commands.Add(new UICommand("FeedbackDialogNoButton".FromLanguageResource())); var result = await md.ShowAsync(); if (result != null && result.Label == rate) { Insights.Track("Review Reminder", "Accepted", "True"); Launcher.LaunchUriAsync(new Uri("ms-windows-store:reviewapp?appid=" + CurrentApp.AppId)); } else { Insights.Track("Review Reminder", "Accepted", "False"); } }
protected override void OnStart() { base.OnStart(); Insights.Track(this.GetType().Name); var disposable = new CompositeDisposable(); NetworkMessenger.Instance.WhenAnyValue(x => x.IsConnected) .ObserveOn(RxApp.MainThreadScheduler) .Subscribe(x => { // Update the enabled state of the network specific buttons foreach (var item in this.drawerAdapter.Where(y => y.ItemType == MainDrawerItemType.Primary).Skip(1)) { item.IsEnabled = x; } this.drawerAdapter.NotifyDataSetChanged(); }).DisposeWith(disposable); this.activationDisposable = disposable; this.StartService(new Intent(this, typeof(NetworkService))); }
public static void ReportViewLoaded(string viewControllerName, string eventDescription) { if (BeerDrinkin.Core.Helpers.Settings.UserTrackingEnabled) { Insights.Track("Loaded AccountView", "ViewController", "AccountViewController"); } }
protected override void OnAppearing() { base.OnAppearing(); Insights.Track(InsightsConstants.WelcomePage); Title = Strings.AppName; CreateLayout(); }
protected override void OnAppearing() { base.OnAppearing(); Title = League.Text; StartTimer(); Insights.Track(InsightsConstants.LeagueResultsPage); cts = new CancellationTokenSource(); _fixturesListView.ItemAppearing += _fixturesListView_ItemAppearing; _fixturesListView.ItemTapped += _fixturesListView_ItemTapped; _fixturesListView.Refreshing += _fixturesListView_Refreshing; _mainNoDataLayout.Refreshing += _fixturesListView_Refreshing; if (absoluteAndroid != null) { if ((Content as AbsoluteLayout).Children[0] != _fixturesListView) { _fixturesListView.BeginRefresh(); } return; } if (Content != _fixturesListView) { _fixturesListView.BeginRefresh(); } }
protected override async void OnAppearing() { base.OnAppearing(); // don't show any content until we're authenticated if (_AuthenticationService.IsAuthenticated) { Content.IsVisible = true; if (!_SalesDashboardChartViewModel.IsInitialized) { await _SalesDashboardChartViewModel.ExecuteLoadSeedDataCommand(); _SalesDashboardChartViewModel.IsInitialized = true; } if (!_SalesDashboardLeadsViewModel.IsInitialized) { await _SalesDashboardLeadsViewModel.ExecuteLoadSeedDataCommand(); _SalesDashboardLeadsViewModel.IsInitialized = true; } Insights.Track(InsightsReportingConstants.PAGE_SALESDASHBOARD); } else { Content.IsVisible = false; } }
public void GetPlaybackUrlError(string status, int tryCount, Track track, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { try { var dictionary = new Dictionary <string, string>() { { "Track Id", track?.Id ?? "NULL" }, { "Song ID", track?.SongId ?? "NULL" }, { "Song type", track?.ServiceExtra2 ?? "NULL" }, { "Status", status }, { "Try Count", tryCount.ToString() }, { "File Extension", track?.FileExtension ?? "NULL" }, { "Media Type", track?.MediaType.ToString() ?? "NULL" }, { "Service Type", track?.ServiceType.ToString() ?? "NULL" }, { "Method", memberName }, { "File", sourceFilePath }, { "Line number", sourceLineNumber.ToString() }, }; Task.Run(() => Insights.Track("Failed to get playback url", dictionary)); } catch (Exception ex) { Console.WriteLine(ex); } }
public virtual async Task <bool> StartServices() { bool isGranted = await Mvx.Resolve <IPermissionsService>().CheckPermissionsAccesGrantedAsync(); if (!IsBound && isGranted) { Log.LogMessage(string.Format("FACADE HAS STARTED AT {0}", DateTime.Now)); Debug.WriteLine("Inside tracking service"); _textToSpeech.IsEnabled = true; _activity.StartDetection(); _geoWatcher.StartGeolocationWatcher(); Insights.Track("Subscribed on LocationMessage."); _locationToken = _messenger.SubscribeOnThreadPoolThread <LocationMessage>(async x => { Log.LogMessage("Start processing LocationMessage"); await CheckTrackStatus(); }); _tokens.Add(_locationToken); Log.LogMessage("Start Facade location detection and subscride on LocationMessage"); return(true); } return(false); }
protected async override void OnAppearing() { base.OnAppearing(); await this.MakeMap(); Insights.Track("Contact Map Page"); }
protected override void OnAppearing() { base.OnAppearing(); Insights.Track("Customer Orders Page"); ViewModel.LoadOrdersCommand.Execute(null); }
protected async override void OnAppearing() { base.OnAppearing(); await this.MakeMap(); Insights.Track(InsightsReportingConstants.PAGE_CUSTOMERMAP); }
partial void btnTakePhoto_TouchUpInside(UIButton sender) { CapturePhoto(); Insights.Track("Photo Taken", new Dictionary <string, string> { { "Flash On", flashOn.ToString() } }); }
protected override void OnAppearing() { base.OnAppearing(); ViewModel.LoadOrdersCommand.Execute(null); Insights.Track(InsightsReportingConstants.PAGE_CUSTOMERORDERS); }
public override void ViewDidLoad() { base.ViewDidLoad(); if (BeerDrinkin.Core.Helpers.Settings.UserTrackingEnabled) { Insights.Track("Loaded AboutView", "ViewController", "AboutViewController"); } }
public static void Track(string pageId, Dictionary <string, string> meta) { if (!IsEnabled) { return; } Insights.Track(pageId, meta); }
public void OnEntry() { //_handle = Insights.TrackTime (_methodName); var message = string.Format("OnEntry: {0}", _methodName); Insights.Track(message); //_handle.Start (); }
public void TrackUsageEventDismissed(bool aVisitedStorePage) { if (Insights.IsInitialized) { Insights.Track(string.Format("NotificationDismissedV{0}", Version), new Dictionary <string, string>() { { "VisitedStore", aVisitedStorePage.ToString() } }); } }
public void OnExit() { var message = string.Format("OnExit: {0}", _methodName); Insights.Track(message); // if (_handle != null) { // _handle.Stop (); // } }
public override void LayoutSubviews() { base.LayoutSubviews(); if (Control != null) { Control.Frame = new RectangleF(0, 0, (float)Element.Width, (float)Element.Height); } Insights.Track("LAYOUT-iOS"); }
protected override void SendTiming(long elapsedMilliseconds, string category, string variable, string label) { SendHit(GAIDictionaryBuilder.CreateTiming(category, elapsedMilliseconds, variable, label)); if (Insights.IsInitialized) { Insights.Track("AppStartupTime", new Dictionary <string, string> { { "ElapsedTime", elapsedMilliseconds.ToString() + "ms" } }); } }