示例#1
0
        public static void Run()
        {
            CrossVersionTracking.Current.Track();

            Crashes.GetErrorAttachment = (report) => ErrorAttachment.AttachmentWithText(CrossVersionTracking.Current.ToString());

            if (!string.IsNullOrEmpty(PrivateKeys.MobileCenter.AppSecret))
            {
                MobileCenter.Start(PrivateKeys.MobileCenter.AppSecret,
                                   typeof(Microsoft.Azure.Mobile.Analytics.Analytics),
                                   typeof(Microsoft.Azure.Mobile.Crashes.Crashes));
            }

            PclExportClient.Configure();

            JsonHttpClient.GlobalHttpMessageHandlerFactory = () => new NativeMessageHandler();

            Settings.RegisterDefaultSettings();

#if __ANDROID__
            Settings.VersionNumber = CrossVersionTracking.Current.CurrentVersion;

            Settings.BuildNumber = CrossVersionTracking.Current.CurrentBuild;
#endif
        }
示例#2
0
 public ErrorAttachment GetErrorAttachment(ErrorReport report)
 {
     Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
     {
         if (GetErrorAttachmentLabel != null)
         {
             GetErrorAttachmentLabel.Text = TestStrings.DidGetErrorAttachmentText;
         }
     });
     return(ErrorAttachment.AttachmentWithText("hello"));
 }
        ErrorAttachment ErrorAttachmentForReport(ErrorReport report)
        {
            MobileCenterLog.Info(LogTag, "Getting error attachment for error report");
            string text = "This is an error attachment for Android";

            if (report.iOSDetails != null)
            {
                text = "This is an error attachment for iOS";
            }

            return(ErrorAttachment.AttachmentWithText(text));
        }