Skip to content

Commit

Permalink
AdvXamarin-0580-TrackingErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
LaloCo committed Sep 28, 2018
1 parent 3a7e8b2 commit dab8f15
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 32 deletions.
6 changes: 4 additions & 2 deletions .vs/Finance/xs/UserPrefs.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Properties StartupConfiguration="{154CC417-21AE-4A00-918F-FD8CD83D3F7B}|Default" GitUserInfo="UsingGIT">
<Properties StartupConfiguration="{8337A36F-24EB-4EA0-909B-C7644191855D}|Default" GitUserInfo="UsingGIT">
<MonoDevelop.Ide.Workbench ActiveDocument="Finance Status">
<Files>
<File FileName="Finance/App.xaml.cs" Line="25" Column="94" />
<File FileName="Finance/View/PostPage.xaml.cs" Line="26" Column="48" />
<File FileName="Finance Status" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.ItemProperties.Finance.iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.804459D3-51C1-45A7-80A8-0E1ECA803C14" automaticSigning="False" />
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.ItemProperties.Finance.Android PreferredExecutionTarget="Android.Android_Accelerated_Nougat" AndroidDesignerPreferredTheme="Theme.DeviceDefault.NoActionBar.Fullscreen" />
<MonoDevelop.Ide.ItemProperties.Finance.Android PreferredExecutionTarget="Android.Android_Accelerated_Oreo" AndroidDesignerPreferredTheme="Theme.DeviceDefault.NoActionBar.Fullscreen" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
Expand Down
Binary file modified .vs/Finance/xs/sqlite3/storage.ide
Binary file not shown.
Binary file modified .vs/Finance/xs/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified .vs/Finance/xs/sqlite3/storage.ide-wal
Binary file not shown.
3 changes: 1 addition & 2 deletions Finance.Android/Finance.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AndroidSupportedAbis>armeabi-v7a;armeabi;x86;arm64-v8a;x86_64</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -32,7 +33,6 @@
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidSupportedAbis>armeabi-v7a</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -42,7 +42,6 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidSupportedAbis>armeabi-v7a;armeabi;x86;arm64-v8a;x86_64</AndroidSupportedAbis>
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>/Users/eduardorosas/Library/Developer/Xamarin/Keystore/LPAFinance/LPAFinance.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>JpvRDN3W$VbVTU@3</AndroidSigningStorePass>
Expand Down
9 changes: 4 additions & 5 deletions Finance/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using Xamarin.Forms.Xaml;
using Finance.View;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using Microsoft.AppCenter.Analytics;

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace Finance
Expand All @@ -20,10 +20,9 @@ public App()

protected override void OnStart()
{
string androidSecret = "8626cb1e-a5e1-43db-a223-14e5deb03fd6";
string iOSSecret = "69127242-7f3e-4c21-9a5a-f191c6a53161";

AppCenter.Start($"android={androidSecret};ios={iOSSecret}", typeof(Analytics), typeof(Crashes));
string androidAppSecret = "8626cb1e-a5e1-43db-a223-14e5deb03fd6";
string iOSAppSecret = "69127242-7f3e-4c21-9a5a-f191c6a53161";
AppCenter.Start($"android={androidAppSecret};ios={iOSAppSecret}", typeof(Crashes));
}

protected override void OnSleep()
Expand Down
17 changes: 12 additions & 5 deletions Finance/View/PostPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using Finance.Model;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using Xamarin.Forms;

Expand All @@ -20,12 +19,20 @@ public PostPage(Item item)
InitializeComponent();
Xamarin.Forms.PlatformConfiguration.iOSSpecific.Page.SetUseSafeArea(this, true);

webView.Source = item.ItemLink;
try
{
throw (new Exception("Unable to load blog"));

Analytics.TrackEvent("Blog post selected", new Dictionary<string, string>
webView.Source = item.ItemLink;
}
catch(Exception ex)
{
{"Blog_Post", $"{item.Title}"}
});
var properties = new Dictionary<string, string>
{
{"Blog_Post", $"{item.Title}"}
};
Crashes.TrackError(ex, properties);
}
}
}
}
24 changes: 6 additions & 18 deletions Finance/ViewModel/MainVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Text;
using System.Xml.Serialization;
using Finance.Model;
using Microsoft.AppCenter.Crashes;

namespace Finance.ViewModel
{
Expand All @@ -27,26 +26,15 @@ public MainVM()

public void ReadRss()
{
try
{
XmlSerializer serializer = new XmlSerializer(typeof(Posts));
XmlSerializer serializer = new XmlSerializer(typeof(Posts));

using (WebClient client = new WebClient())
{
string xml = Encoding.Default.GetString(client.DownloadData("https://www.finzen.mx/blog-feed.xml"));
using (Stream reader = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
{
Blog = (Posts)serializer.Deserialize(reader);
}
}
}
catch(Exception ex)
using (WebClient client = new WebClient())
{
var infoDictionary = new Dictionary<string, string>
string xml = Encoding.Default.GetString(client.DownloadData("https://www.finzen.mx/blog-feed.xml"));
using (Stream reader = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
{
{"RSS", "Reading RSS"}
};
Crashes.TrackError(ex, infoDictionary);
Blog = (Posts)serializer.Deserialize(reader);
}
}
}

Expand Down

0 comments on commit dab8f15

Please sign in to comment.