diff --git a/Apps/Contoso.Android.Puppet/Contoso.Android.Puppet.csproj b/Apps/Contoso.Android.Puppet/Contoso.Android.Puppet.csproj
index 2a2198694..b62b2cf3c 100644
--- a/Apps/Contoso.Android.Puppet/Contoso.Android.Puppet.csproj
+++ b/Apps/Contoso.Android.Puppet/Contoso.Android.Puppet.csproj
@@ -104,6 +104,7 @@
+
diff --git a/Apps/Contoso.Android.Puppet/CrashActivity.cs b/Apps/Contoso.Android.Puppet/CrashActivity.cs
new file mode 100644
index 000000000..992735063
--- /dev/null
+++ b/Apps/Contoso.Android.Puppet/CrashActivity.cs
@@ -0,0 +1,14 @@
+using Android.App;
+using Android.OS;
+
+namespace Contoso.Android.Puppet
+{
+ [Activity(Label = "CrashActivity")]
+ public class CrashActivity : Activity
+ {
+ protected override void OnCreate(Bundle savedInstanceState)
+ {
+ // will crash with super not called, a pure Java exception with no .NET crash handler.
+ }
+ }
+}
diff --git a/Apps/Contoso.Android.Puppet/MainActivity.cs b/Apps/Contoso.Android.Puppet/MainActivity.cs
index b826e883e..b6facb4f4 100644
--- a/Apps/Contoso.Android.Puppet/MainActivity.cs
+++ b/Apps/Contoso.Android.Puppet/MainActivity.cs
@@ -51,17 +51,27 @@ protected override void OnCreate(Bundle savedInstanceState)
Distribute.ReleaseAvailable = OnReleaseAvailable;
MobileCenterLog.Assert(LogTag, "MobileCenter.Configured=" + MobileCenter.Configured);
- MobileCenterLog.Assert(LogTag, "MobileCenter.InstallId (before configure)=" + MobileCenter.InstallId);
MobileCenter.SetLogUrl("https://in-integration.dev.avalanch.es");
Distribute.SetInstallUrl("http://install.asgard-int.trafficmanager.net");
Distribute.SetApiUrl("https://asgard-int.trafficmanager.net/api/v0.1");
MobileCenter.Start("bff0949b-7970-439d-9745-92cdc59b10fe", typeof(Analytics), typeof(Crashes), typeof(Distribute));
- MobileCenterLog.Info(LogTag, "MobileCenter.InstallId=" + MobileCenter.InstallId);
- MobileCenterLog.Info(LogTag, "Crashes.HasCrashedInLastSession=" + Crashes.HasCrashedInLastSession);
+ MobileCenter.IsEnabledAsync().ContinueWith(enabled =>
+ {
+ MobileCenterLog.Info(LogTag, "MobileCenter.Enabled=" + enabled.Result);
+ });
+ MobileCenter.GetInstallIdAsync().ContinueWith(installId =>
+ {
+ MobileCenterLog.Info(LogTag, "MobileCenter.InstallId=" + installId.Result);
+ });
+ Crashes.HasCrashedInLastSessionAsync().ContinueWith(hasCrashed =>
+ {
+ MobileCenterLog.Info(LogTag, "Crashes.HasCrashedInLastSession=" + hasCrashed.Result);
+ });
Crashes.GetLastSessionCrashReportAsync().ContinueWith(report =>
{
- MobileCenterLog.Info(LogTag, " Crashes.LastSessionCrashReport.Exception=" + report.Result?.Exception);
+ MobileCenterLog.Info(LogTag, "Crashes.LastSessionCrashReport.Exception=" + report.Result?.Exception);
+ MobileCenterLog.Info(LogTag, "Crashes.LastSessionCrashReport.Throwable=" + report.Result?.AndroidDetails?.Throwable);
});
}
diff --git a/Apps/Contoso.Android.Puppet/ModulePages/AnalyticsFragment.cs b/Apps/Contoso.Android.Puppet/ModulePages/AnalyticsFragment.cs
index 7fd664eef..874dddf0d 100644
--- a/Apps/Contoso.Android.Puppet/ModulePages/AnalyticsFragment.cs
+++ b/Apps/Contoso.Android.Puppet/ModulePages/AnalyticsFragment.cs
@@ -47,20 +47,20 @@ public override void OnViewCreated(View view, Bundle savedInstanceState)
UpdateState();
}
- protected override void UpdateState()
+ protected override async void UpdateState()
{
AnalyticsEnabledSwitch.CheckedChange -= UpdateEnabled;
AnalyticsEnabledSwitch.Enabled = true;
- AnalyticsEnabledSwitch.Checked = Analytics.Enabled;
- AnalyticsEnabledSwitch.Enabled = MobileCenter.Enabled;
+ AnalyticsEnabledSwitch.Checked = await Analytics.IsEnabledAsync();
+ AnalyticsEnabledSwitch.Enabled = await MobileCenter.IsEnabledAsync();
AnalyticsEnabledSwitch.CheckedChange += UpdateEnabled;
PropertiesCountLabel.Text = mEventProperties.Count.ToString();
}
- private void UpdateEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
+ private async void UpdateEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
{
- Analytics.Enabled = e.IsChecked;
- AnalyticsEnabledSwitch.Checked = Analytics.Enabled;
+ await Analytics.SetEnabledAsync(e.IsChecked);
+ AnalyticsEnabledSwitch.Checked = await Analytics.IsEnabledAsync();
}
private void Properties(object sender, EventArgs e)
diff --git a/Apps/Contoso.Android.Puppet/ModulePages/CrashesFragment.cs b/Apps/Contoso.Android.Puppet/ModulePages/CrashesFragment.cs
index 14c423f67..114473ac8 100644
--- a/Apps/Contoso.Android.Puppet/ModulePages/CrashesFragment.cs
+++ b/Apps/Contoso.Android.Puppet/ModulePages/CrashesFragment.cs
@@ -1,5 +1,6 @@
using System;
using System.IO;
+using Android.Content;
using Android.OS;
using Android.Views;
using Android.Widget;
@@ -17,6 +18,7 @@ public class CrashesFragment : PageFragment
private Button CrashWithNullReferenceExceptionButton;
private Button CatchNullReferenceExceptionButton;
private Button CrashAsyncButton;
+ private Button CrashSuperNotCalledButton;
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
@@ -35,6 +37,7 @@ public override void OnViewCreated(View view, Bundle savedInstanceState)
CrashWithNullReferenceExceptionButton = view.FindViewById(Resource.Id.crash_with_null_reference_exception) as Button;
CatchNullReferenceExceptionButton = view.FindViewById(Resource.Id.catch_null_reference_exception) as Button;
CrashAsyncButton = view.FindViewById(Resource.Id.crash_async) as Button;
+ CrashSuperNotCalledButton = view.FindViewById(Resource.Id.crash_super_not_called) as Button;
// Subscribe to events.
CrashesEnabledSwitch.CheckedChange += UpdateEnabled;
@@ -44,23 +47,24 @@ public override void OnViewCreated(View view, Bundle savedInstanceState)
CrashWithNullReferenceExceptionButton.Click += CrashWithNullReferenceException;
CatchNullReferenceExceptionButton.Click += CatchNullReferenceException;
CrashAsyncButton.Click += CrashAsync;
+ CrashSuperNotCalledButton.Click += CrashSuperNotCalled;
UpdateState();
}
- protected override void UpdateState()
+ protected override async void UpdateState()
{
CrashesEnabledSwitch.CheckedChange -= UpdateEnabled;
CrashesEnabledSwitch.Enabled = true;
- CrashesEnabledSwitch.Checked = Crashes.Enabled;
- CrashesEnabledSwitch.Enabled = MobileCenter.Enabled;
+ CrashesEnabledSwitch.Checked = await Crashes.IsEnabledAsync();
+ CrashesEnabledSwitch.Enabled = await MobileCenter.IsEnabledAsync();
CrashesEnabledSwitch.CheckedChange += UpdateEnabled;
}
- private void UpdateEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
+ private async void UpdateEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
{
- Crashes.Enabled = e.IsChecked;
- CrashesEnabledSwitch.Checked = Crashes.Enabled;
+ await Crashes.SetEnabledAsync(e.IsChecked);
+ CrashesEnabledSwitch.Checked = await Crashes.IsEnabledAsync();
}
private void TestCrash(object sender, EventArgs e)
@@ -115,6 +119,11 @@ async private void CrashAsync(object sender, EventArgs e)
await FakeService.DoStuffInBackground();
}
+ private void CrashSuperNotCalled(object sender, EventArgs e)
+ {
+ StartActivity(new Intent(Activity, typeof(CrashActivity)));
+ }
+
static Exception PrepareException()
{
try
diff --git a/Apps/Contoso.Android.Puppet/ModulePages/DistributeFragment.cs b/Apps/Contoso.Android.Puppet/ModulePages/DistributeFragment.cs
index 983e13504..8c0f5a442 100644
--- a/Apps/Contoso.Android.Puppet/ModulePages/DistributeFragment.cs
+++ b/Apps/Contoso.Android.Puppet/ModulePages/DistributeFragment.cs
@@ -28,19 +28,19 @@ public override void OnViewCreated(View view, Bundle savedInstanceState)
UpdateState();
}
- protected override void UpdateState()
+ protected override async void UpdateState()
{
DistributeEnabledSwitch.CheckedChange -= UpdateEnabled;
DistributeEnabledSwitch.Enabled = true;
- DistributeEnabledSwitch.Checked = Distribute.Enabled;
- DistributeEnabledSwitch.Enabled = MobileCenter.Enabled;
+ DistributeEnabledSwitch.Checked = await Distribute.IsEnabledAsync();
+ DistributeEnabledSwitch.Enabled = await MobileCenter.IsEnabledAsync();
DistributeEnabledSwitch.CheckedChange += UpdateEnabled;
}
- private void UpdateEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
+ private async void UpdateEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
{
- Distribute.Enabled = e.IsChecked;
- DistributeEnabledSwitch.Checked = Distribute.Enabled;
+ await Distribute.SetEnabledAsync(e.IsChecked);
+ DistributeEnabledSwitch.Checked = await Distribute.IsEnabledAsync();
}
}
}
diff --git a/Apps/Contoso.Android.Puppet/ModulePages/MobileCenterFragment.cs b/Apps/Contoso.Android.Puppet/ModulePages/MobileCenterFragment.cs
index 023200808..18511809c 100644
--- a/Apps/Contoso.Android.Puppet/ModulePages/MobileCenterFragment.cs
+++ b/Apps/Contoso.Android.Puppet/ModulePages/MobileCenterFragment.cs
@@ -61,10 +61,10 @@ public override void OnViewCreated(View view, Bundle savedInstanceState)
UpdateState();
}
- protected override void UpdateState()
+ protected override async void UpdateState()
{
MobileCenterEnabledSwitch.CheckedChange -= UpdateEnabled;
- MobileCenterEnabledSwitch.Checked = MobileCenter.Enabled;
+ MobileCenterEnabledSwitch.Checked = await MobileCenter.IsEnabledAsync();
MobileCenterEnabledSwitch.CheckedChange += UpdateEnabled;
LogLevelLabel.Text = LogLevelNames[MobileCenter.LogLevel];
LogWriteLevelLabel.Text = LogLevelNames[mLogWriteLevel];
@@ -91,10 +91,10 @@ public override void OnActivityResult(int requestCode, int resultCode, Intent da
}
}
- private void UpdateEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
+ private async void UpdateEnabled(object sender, CompoundButton.CheckedChangeEventArgs e)
{
- MobileCenter.Enabled = e.IsChecked;
- MobileCenterEnabledSwitch.Checked = MobileCenter.Enabled;
+ await MobileCenter.SetEnabledAsync(e.IsChecked);
+ MobileCenterEnabledSwitch.Checked = await MobileCenter.IsEnabledAsync();
}
private void LogLevelClicked(object sender, EventArgs e)
diff --git a/Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml b/Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml
index 46e3bbd88..ab1707c2d 100644
--- a/Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml
+++ b/Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs b/Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs
index c656c9296..71847ff6a 100644
--- a/Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs
+++ b/Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs
@@ -25,5 +25,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/Apps/Contoso.Android.Puppet/Resources/layout/Crashes.axml b/Apps/Contoso.Android.Puppet/Resources/layout/Crashes.axml
index bc4832bb4..f390cb544 100644
--- a/Apps/Contoso.Android.Puppet/Resources/layout/Crashes.axml
+++ b/Apps/Contoso.Android.Puppet/Resources/layout/Crashes.axml
@@ -60,6 +60,11 @@
android:text="@string/CrashAsync"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
+
\ No newline at end of file
diff --git a/Apps/Contoso.Android.Puppet/Resources/values/Strings.xml b/Apps/Contoso.Android.Puppet/Resources/values/Strings.xml
index dfbe6bae3..6ed023444 100644
--- a/Apps/Contoso.Android.Puppet/Resources/values/Strings.xml
+++ b/Apps/Contoso.Android.Puppet/Resources/values/Strings.xml
@@ -1,41 +1,37 @@
Mobile Center Puppet
- Mobile Center
- Analytics
- Crashes
- Distribute
-
- Mobile Center Enabled
- Log Level
- Log Message
- Log Tag
- Write Log
-
- Analytics Enabled
- Event Name
- Properties
- Add Property
- Track Event
-
- Crashes Enabled
- Generate Test Crash
- Divide 42 by 0
- Crash With Aggregate Exception
- Crash With NullReferenceException
- Test Catching NullReferenceException
- Crash Inside Async Task
-
- Distribute Enabled
-
+ Mobile Center
+ Analytics
+ Crashes
+ Distribute
+ Mobile Center Enabled
+ Log Level
+ Log Message
+ Log Tag
+ Write Log
+ Analytics Enabled
+ Event Name
+ Properties
+ Add Property
+ Track Event
+ Crashes Enabled
+ Generate Test Crash
+ Divide 42 by 0
+ Crash With Aggregate Exception
+ Crash With NullReferenceException
+ Test Catching NullReferenceException
+ Crash Inside Async Task
+ Crash Java: SuperNotCalledException
+ Distribute Enabled
Unexpected crash found
- Would you like to send an anonymous report so we can fix the problem?
- Don\'t Send
- Always Send
- Send
- Version {0} available!
- Add Property
- Please enter a property values to add to the event
- Add Property
- Cancel
+ Would you like to send an anonymous report so we can fix the problem?
+ Don\'t Send
+ Always Send
+ Send
+ Version {0} available!
+ Add Property
+ Please enter a property values to add to the event
+ Add Property
+ Cancel
\ No newline at end of file
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/AndroidEnvironment.cfg b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/AndroidEnvironment.cfg
new file mode 100644
index 000000000..066909a14
--- /dev/null
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/AndroidEnvironment.cfg
@@ -0,0 +1 @@
+ XA_BROKEN_EXCEPTION_TRANSITIONS=true
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Contoso.Forms.Puppet.Droid.csproj b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Contoso.Forms.Puppet.Droid.csproj
index 73d5ab837..5c0438a3e 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Contoso.Forms.Puppet.Droid.csproj
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Contoso.Forms.Puppet.Droid.csproj
@@ -32,6 +32,7 @@
None
false
true
+ arm64-v8a;armeabi;armeabi-v7a;x86;x86_64
true
@@ -138,6 +139,12 @@
..\..\..\packages\Xamarin.Firebase.Messaging.42.1024.0-beta1\lib\MonoAndroid70\Xamarin.Firebase.Messaging.dll
+
+ ..\..\..\packages\HockeySDK.Xamarin.4.1.5\lib\MonoAndroid403\HockeySDK.AndroidBindings.dll
+
+
+ ..\..\..\packages\HockeySDK.Xamarin.4.1.5\lib\MonoAndroid403\HockeySDK.dll
+
@@ -210,6 +217,9 @@
+
+
+
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs
index c5dd1aa7a..bf1962417 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs
@@ -4,6 +4,8 @@
using Com.Microsoft.Azure.Mobile.Analytics;
using Com.Microsoft.Azure.Mobile.Analytics.Channel;
using Com.Microsoft.Azure.Mobile.Ingestion.Models;
+using HockeyApp.Android;
+using HockeyApp.Android.Utils;
using Microsoft.Azure.Mobile;
using Microsoft.Azure.Mobile.Push;
@@ -26,6 +28,13 @@ protected override void OnCreate(Bundle savedInstanceState)
LoadApplication(new App());
}
+ protected override void OnResume()
+ {
+ base.OnResume();
+ HockeyLog.LogLevel = 2;
+ CrashManager.Register(this, "2c7e569100194bafa2a30f5c648d44fe");
+ }
+
protected override void OnNewIntent(Android.Content.Intent intent)
{
base.OnNewIntent(intent);
@@ -50,5 +59,4 @@ public void OnBeforeSending(ILog log)
MobileCenterLog.Debug(App.LogTag, "Analytics listener OnBeforeSendingEventLog");
}
}
-
}
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml
index 5ec8e8df5..1f99850d8 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AssemblyInfo.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AssemblyInfo.cs
index c4225d563..d63607b40 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AssemblyInfo.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AssemblyInfo.cs
@@ -19,8 +19,8 @@
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/packages.config b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/packages.config
index 2e878e16b..9931277d9 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/packages.config
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/packages.config
@@ -1,5 +1,6 @@
+
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Package.appxmanifest b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Package.appxmanifest
index ba0a9e107..7d3956d1a 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Package.appxmanifest
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Package.appxmanifest
@@ -1,6 +1,6 @@
-
+
MobileCenter-Forms-UWP-Puppet
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs
index fb9e85dd0..f744ed28d 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
[assembly: ComVisible(false)]
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist
index 627bb0998..b53775599 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist
@@ -5,9 +5,9 @@
CFBundleIdentifier
com.microsoft.azure.mobile.xamarin.forms.puppet
CFBundleShortVersionString
- 0.13.1
+ 0.14.0
CFBundleVersion
- 0.13.1
+ 0.14.0
LSRequiresIPhoneOS
MinimumOSVersion
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/App.xaml.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/App.xaml.cs
index 9180d3a32..0f8e41f2e 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/App.xaml.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/App.xaml.cs
@@ -51,7 +51,6 @@ protected override void OnStart()
Distribute.ReleaseAvailable = OnReleaseAvailable;
MobileCenterLog.Assert(LogTag, "MobileCenter.Configured=" + MobileCenter.Configured);
- MobileCenterLog.Assert(LogTag, "MobileCenter.InstallId (before configure)=" + MobileCenter.InstallId);
MobileCenter.SetLogUrl("https://in-integration.dev.avalanch.es");
Distribute.SetInstallUrl("http://install.asgard-int.trafficmanager.net");
Distribute.SetApiUrl("https://asgard-int.trafficmanager.net/api/v0.1");
@@ -74,8 +73,18 @@ protected override void OnStart()
MobileCenter.Start($"uwp={uwpKey};android={androidKey};ios={iosKey}",
typeof(Analytics), typeof(Crashes), typeof(Distribute), typeof(Push));
- MobileCenterLog.Info(LogTag, "MobileCenter.InstallId=" + MobileCenter.InstallId);
- MobileCenterLog.Info(LogTag, "Crashes.HasCrashedInLastSession=" + Crashes.HasCrashedInLastSession);
+ MobileCenter.IsEnabledAsync().ContinueWith(enabled =>
+ {
+ MobileCenterLog.Info(LogTag, "MobileCenter.Enabled=" + enabled.Result);
+ });
+ MobileCenter.GetInstallIdAsync().ContinueWith(installId =>
+ {
+ MobileCenterLog.Info(LogTag, "MobileCenter.InstallId=" + installId.Result);
+ });
+ Crashes.HasCrashedInLastSessionAsync().ContinueWith(hasCrashed =>
+ {
+ MobileCenterLog.Info(LogTag, "Crashes.HasCrashedInLastSession=" + hasCrashed.Result);
+ });
Crashes.GetLastSessionCrashReportAsync().ContinueWith(report =>
{
MobileCenterLog.Info(LogTag, "Crashes.LastSessionCrashReport.Exception=" + report.Result?.Exception);
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/AnalyticsContentPage.xaml.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/AnalyticsContentPage.xaml.cs
index 1a9d023c3..b6bb1692e 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/AnalyticsContentPage.xaml.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/AnalyticsContentPage.xaml.cs
@@ -34,11 +34,11 @@ public AnalyticsContentPage()
}
}
- protected override void OnAppearing()
+ protected override async void OnAppearing()
{
base.OnAppearing();
- EnabledSwitchCell.On = Analytics.Enabled;
- EnabledSwitchCell.IsEnabled = MobileCenter.Enabled;
+ EnabledSwitchCell.On = await Analytics.IsEnabledAsync();
+ EnabledSwitchCell.IsEnabled = await MobileCenter.IsEnabledAsync();
}
async void AddProperty(object sender, EventArgs e)
@@ -77,9 +77,9 @@ void TrackEvent(object sender, EventArgs e)
}
- void UpdateEnabled(object sender, ToggledEventArgs e)
+ async void UpdateEnabled(object sender, ToggledEventArgs e)
{
- Analytics.Enabled = e.Value;
+ await Analytics.SetEnabledAsync(e.Value);
}
void RefreshPropCount()
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/CrashesContentPage.xaml.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/CrashesContentPage.xaml.cs
index 4ecba8458..275e74e94 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/CrashesContentPage.xaml.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/CrashesContentPage.xaml.cs
@@ -18,11 +18,11 @@ public CrashesContentPage()
}
}
- protected override void OnAppearing()
+ protected override async void OnAppearing()
{
base.OnAppearing();
- CrashesEnabledSwitchCell.On = Crashes.Enabled;
- CrashesEnabledSwitchCell.IsEnabled = MobileCenter.Enabled;
+ CrashesEnabledSwitchCell.On = await Crashes.IsEnabledAsync();
+ CrashesEnabledSwitchCell.IsEnabled = await MobileCenter.IsEnabledAsync();
}
void TestCrash(object sender, EventArgs e)
@@ -38,9 +38,9 @@ void DivideByZero(object sender, EventArgs e)
#pragma warning restore CS0219
}
- void UpdateEnabled(object sender, ToggledEventArgs e)
+ async void UpdateEnabled(object sender, ToggledEventArgs e)
{
- Crashes.Enabled = e.Value;
+ await Crashes.SetEnabledAsync(e.Value);
}
void GenerateTestCrash(object sender, EventArgs e)
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/MobileCenterContentPage.xaml.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/MobileCenterContentPage.xaml.cs
index f9447c9d0..ed5654e2e 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/MobileCenterContentPage.xaml.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/MobileCenterContentPage.xaml.cs
@@ -42,12 +42,11 @@ public MobileCenterContentPage()
}
}
- protected override void OnAppearing()
+ protected override async void OnAppearing()
{
base.OnAppearing();
LogLevelLabel.Text = LogLevelNames[MobileCenter.LogLevel];
- MobileCenterEnabledSwitchCell.On = MobileCenter.Enabled;
-
+ MobileCenterEnabledSwitchCell.On = await MobileCenter.IsEnabledAsync();
}
void LogLevelCellTapped(object sender, EventArgs e)
@@ -78,9 +77,9 @@ void WriteLog(object sender, System.EventArgs e)
LogFunctions[LogWriteLevel](tag, message);
}
- void UpdateEnabled(object sender, ToggledEventArgs e)
+ async void UpdateEnabled(object sender, ToggledEventArgs e)
{
- MobileCenter.Enabled = e.Value;
+ await MobileCenter.SetEnabledAsync(e.Value);
}
void UpdateLogWriteLevelLabel()
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/OthersContentPage.xaml.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/OthersContentPage.xaml.cs
index fc1ab941c..342fcd7a5 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/OthersContentPage.xaml.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/OthersContentPage.xaml.cs
@@ -27,12 +27,13 @@ public OthersContentPage()
}
}
- protected override void OnAppearing()
+ protected override async void OnAppearing()
{
base.OnAppearing();
- DistributeEnabledSwitchCell.On = Distribute.Enabled;
- DistributeEnabledSwitchCell.IsEnabled = MobileCenter.Enabled;
- PushEnabledSwitchCell.On = Push.Enabled;
+ DistributeEnabledSwitchCell.On = await Distribute.IsEnabledAsync();
+ DistributeEnabledSwitchCell.IsEnabled = await MobileCenter.IsEnabledAsync();
+ PushEnabledSwitchCell.On = await Push.IsEnabledAsync();
+ PushEnabledSwitchCell.IsEnabled = await MobileCenter.IsEnabledAsync();
if (XamarinDevice.RuntimePlatform == XamarinDevice.Android)
{
if (!Application.Current.Properties.ContainsKey(FirebaseEnabledKey))
@@ -43,14 +44,14 @@ protected override void OnAppearing()
}
}
- void UpdateDistributeEnabled(object sender, ToggledEventArgs e)
+ async void UpdateDistributeEnabled(object sender, ToggledEventArgs e)
{
- Distribute.Enabled = e.Value;
+ await Distribute.SetEnabledAsync(e.Value);
}
- void UpdatePushEnabled(object sender, ToggledEventArgs e)
+ async void UpdatePushEnabled(object sender, ToggledEventArgs e)
{
- Push.Enabled = e.Value;
+ await Push.SetEnabledAsync(e.Value);
}
void UpdateFirebaseAnalyticsEnabled(object sender, ToggledEventArgs e)
diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/Properties/AssemblyInfo.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/Properties/AssemblyInfo.cs
index c754afdf0..8e979a267 100644
--- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/Properties/AssemblyInfo.cs
+++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/Properties/AssemblyInfo.cs
@@ -17,8 +17,8 @@
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/Apps/Contoso.UWP.Puppet/Package.appxmanifest b/Apps/Contoso.UWP.Puppet/Package.appxmanifest
index 8a0295403..049c5d22b 100644
--- a/Apps/Contoso.UWP.Puppet/Package.appxmanifest
+++ b/Apps/Contoso.UWP.Puppet/Package.appxmanifest
@@ -1,6 +1,6 @@
-
+
MobileCenter-UWP-Puppet
diff --git a/Apps/Contoso.UWP.Puppet/Properties/AssemblyInfo.cs b/Apps/Contoso.UWP.Puppet/Properties/AssemblyInfo.cs
index d809e52d5..8f36c7b79 100644
--- a/Apps/Contoso.UWP.Puppet/Properties/AssemblyInfo.cs
+++ b/Apps/Contoso.UWP.Puppet/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/Apps/Contoso.iOS.Puppet/AppDelegate.cs b/Apps/Contoso.iOS.Puppet/AppDelegate.cs
index faa1a1a13..dd2dbb4bf 100644
--- a/Apps/Contoso.iOS.Puppet/AppDelegate.cs
+++ b/Apps/Contoso.iOS.Puppet/AppDelegate.cs
@@ -41,8 +41,8 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary l
MobileCenterLog.Verbose("THETAG", "THEMESSAGE", e);
}
- Analytics.Enabled = true;
- System.Diagnostics.Debug.WriteLine("ANALYTICS: " + Analytics.Enabled.ToString());
+ Analytics.SetEnabledAsync(true);
+ System.Diagnostics.Debug.WriteLine("ANALYTICS: " + Analytics.IsEnabledAsync().Result);
return true;
}
diff --git a/Apps/Contoso.iOS.Puppet/Contoso.iOS.Puppet.csproj b/Apps/Contoso.iOS.Puppet/Contoso.iOS.Puppet.csproj
index 26c7a8555..9796e367c 100644
--- a/Apps/Contoso.iOS.Puppet/Contoso.iOS.Puppet.csproj
+++ b/Apps/Contoso.iOS.Puppet/Contoso.iOS.Puppet.csproj
@@ -190,4 +190,9 @@
+
+
+
+ mcs.exe
+
\ No newline at end of file
diff --git a/Apps/Contoso.iOS.Puppet/Info.plist b/Apps/Contoso.iOS.Puppet/Info.plist
index d48ea6cb1..fc42327d7 100644
--- a/Apps/Contoso.iOS.Puppet/Info.plist
+++ b/Apps/Contoso.iOS.Puppet/Info.plist
@@ -7,9 +7,9 @@
CFBundleIdentifier
com.microsoft.azure.mobile.xamarin.puppet
CFBundleShortVersionString
- 0.13.1
+ 0.14.0
CFBundleVersion
- 0.13.1
+ 0.14.0
LSRequiresIPhoneOS
MinimumOSVersion
diff --git a/Apps/Contoso.iOS.Puppet/ModulePages/AnalyticsController.cs b/Apps/Contoso.iOS.Puppet/ModulePages/AnalyticsController.cs
index 8eb501d03..7f627516c 100644
--- a/Apps/Contoso.iOS.Puppet/ModulePages/AnalyticsController.cs
+++ b/Apps/Contoso.iOS.Puppet/ModulePages/AnalyticsController.cs
@@ -49,8 +49,8 @@ public AnalyticsController(IntPtr handle) : base(handle)
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
- AnalyticsEnabledSwitch.On = Analytics.Enabled;
- AnalyticsEnabledSwitch.Enabled = MobileCenter.Enabled;
+ AnalyticsEnabledSwitch.On = Analytics.IsEnabledAsync().Result;
+ AnalyticsEnabledSwitch.Enabled = MobileCenter.IsEnabledAsync().Result;
NumPropertiesLabel.Text = mEventProperties.Count.ToString();
}
@@ -67,8 +67,8 @@ public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
partial void UpdateEnabled()
{
- Analytics.Enabled = AnalyticsEnabledSwitch.On;
- AnalyticsEnabledSwitch.On = Analytics.Enabled;
+ Analytics.SetEnabledAsync(AnalyticsEnabledSwitch.On).Wait();
+ AnalyticsEnabledSwitch.On = Analytics.IsEnabledAsync().Result;
}
partial void AddProperty()
diff --git a/Apps/Contoso.iOS.Puppet/ModulePages/AnalyticsController.designer.cs b/Apps/Contoso.iOS.Puppet/ModulePages/AnalyticsController.designer.cs
index 315273f39..ef4a34d9b 100644
--- a/Apps/Contoso.iOS.Puppet/ModulePages/AnalyticsController.designer.cs
+++ b/Apps/Contoso.iOS.Puppet/ModulePages/AnalyticsController.designer.cs
@@ -1,51 +1,57 @@
// WARNING
//
-// This file has been generated automatically by Xamarin Studio to store outlets and
-// actions made in the UI designer. If it is removed, they will be lost.
-// Manual changes to this file may not be handled correctly.
+// This file has been generated automatically by Visual Studio from the outlets and
+// actions declared in your storyboard file.
+// Manual changes to this file will not be maintained.
//
using Foundation;
+using System;
using System.CodeDom.Compiler;
namespace Contoso.iOS.Puppet
{
- [Register ("AnalyticsController")]
- partial class AnalyticsController
- {
- [Outlet]
- UIKit.UISwitch AnalyticsEnabledSwitch { get; set; }
-
- [Outlet]
- UIKit.UITextField EventName { get; set; }
-
- [Outlet]
- UIKit.UILabel NumPropertiesLabel { get; set; }
-
- [Action ("AddProperty")]
- partial void AddProperty ();
-
- [Action ("TrackEvent")]
- partial void TrackEvent ();
-
- [Action ("UpdateEnabled")]
- partial void UpdateEnabled ();
-
- void ReleaseDesignerOutlets ()
- {
- if (AnalyticsEnabledSwitch != null) {
- AnalyticsEnabledSwitch.Dispose ();
- AnalyticsEnabledSwitch = null;
- }
-
- if (EventName != null) {
- EventName.Dispose ();
- EventName = null;
- }
-
- if (NumPropertiesLabel != null) {
- NumPropertiesLabel.Dispose ();
- NumPropertiesLabel = null;
- }
- }
- }
-}
+ [Register ("AnalyticsController")]
+ partial class AnalyticsController
+ {
+ [Outlet]
+ UIKit.UISwitch AnalyticsEnabledSwitch { get; set; }
+
+
+ [Outlet]
+ UIKit.UITextField EventName { get; set; }
+
+
+ [Outlet]
+ UIKit.UILabel NumPropertiesLabel { get; set; }
+
+
+ [Action ("AddProperty")]
+ partial void AddProperty ();
+
+
+ [Action ("TrackEvent")]
+ partial void TrackEvent ();
+
+
+ [Action ("UpdateEnabled")]
+ partial void UpdateEnabled ();
+
+ void ReleaseDesignerOutlets ()
+ {
+ if (AnalyticsEnabledSwitch != null) {
+ AnalyticsEnabledSwitch.Dispose ();
+ AnalyticsEnabledSwitch = null;
+ }
+
+ if (EventName != null) {
+ EventName.Dispose ();
+ EventName = null;
+ }
+
+ if (NumPropertiesLabel != null) {
+ NumPropertiesLabel.Dispose ();
+ NumPropertiesLabel = null;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Apps/Contoso.iOS.Puppet/ModulePages/CrashesController.cs b/Apps/Contoso.iOS.Puppet/ModulePages/CrashesController.cs
index ee24cc7f9..c830dd5bf 100644
--- a/Apps/Contoso.iOS.Puppet/ModulePages/CrashesController.cs
+++ b/Apps/Contoso.iOS.Puppet/ModulePages/CrashesController.cs
@@ -15,14 +15,14 @@ public CrashesController(IntPtr handle) : base(handle)
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
- CrashesEnabledSwitch.On = Crashes.Enabled;
- CrashesEnabledSwitch.Enabled = MobileCenter.Enabled;
+ CrashesEnabledSwitch.On = Crashes.IsEnabledAsync().Result;
+ CrashesEnabledSwitch.Enabled = MobileCenter.IsEnabledAsync().Result;
}
partial void UpdateEnabled()
{
- Crashes.Enabled = CrashesEnabledSwitch.On;
- CrashesEnabledSwitch.On = Crashes.Enabled;
+ Crashes.SetEnabledAsync(CrashesEnabledSwitch.On).Wait();
+ CrashesEnabledSwitch.On = Crashes.IsEnabledAsync().Result;
}
partial void TestCrash()
diff --git a/Apps/Contoso.iOS.Puppet/ModulePages/CrashesController.designer.cs b/Apps/Contoso.iOS.Puppet/ModulePages/CrashesController.designer.cs
index b0dcf3610..356e165b0 100644
--- a/Apps/Contoso.iOS.Puppet/ModulePages/CrashesController.designer.cs
+++ b/Apps/Contoso.iOS.Puppet/ModulePages/CrashesController.designer.cs
@@ -1,47 +1,55 @@
// WARNING
//
-// This file has been generated automatically by Xamarin Studio to store outlets and
-// actions made in the UI designer. If it is removed, they will be lost.
-// Manual changes to this file may not be handled correctly.
+// This file has been generated automatically by Visual Studio from the outlets and
+// actions declared in your storyboard file.
+// Manual changes to this file will not be maintained.
//
using Foundation;
+using System;
using System.CodeDom.Compiler;
namespace Contoso.iOS.Puppet
{
- [Register ("CrashesController")]
- partial class CrashesController
- {
- [Outlet]
- UIKit.UISwitch CrashesEnabledSwitch { get; set; }
-
- [Action ("CatchNullReferenceException")]
- partial void CatchNullReferenceException ();
-
- [Action ("CrashAsync")]
- partial void CrashAsync ();
-
- [Action ("CrashWithAggregateException")]
- partial void CrashWithAggregateException ();
-
- [Action ("CrashWithNullReferenceException")]
- partial void CrashWithNullReferenceException ();
-
- [Action ("DivideByZero")]
- partial void DivideByZero ();
-
- [Action ("TestCrash")]
- partial void TestCrash ();
-
- [Action ("UpdateEnabled")]
- partial void UpdateEnabled ();
-
- void ReleaseDesignerOutlets ()
- {
- if (CrashesEnabledSwitch != null) {
- CrashesEnabledSwitch.Dispose ();
- CrashesEnabledSwitch = null;
- }
- }
- }
-}
+ [Register ("CrashesController")]
+ partial class CrashesController
+ {
+ [Outlet]
+ UIKit.UISwitch CrashesEnabledSwitch { get; set; }
+
+
+ [Action ("CatchNullReferenceException")]
+ partial void CatchNullReferenceException ();
+
+
+ [Action ("CrashAsync")]
+ partial void CrashAsync ();
+
+
+ [Action ("CrashWithAggregateException")]
+ partial void CrashWithAggregateException ();
+
+
+ [Action ("CrashWithNullReferenceException")]
+ partial void CrashWithNullReferenceException ();
+
+
+ [Action ("DivideByZero")]
+ partial void DivideByZero ();
+
+
+ [Action ("TestCrash")]
+ partial void TestCrash ();
+
+
+ [Action ("UpdateEnabled")]
+ partial void UpdateEnabled ();
+
+ void ReleaseDesignerOutlets ()
+ {
+ if (CrashesEnabledSwitch != null) {
+ CrashesEnabledSwitch.Dispose ();
+ CrashesEnabledSwitch = null;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Apps/Contoso.iOS.Puppet/ModulePages/DistributeController.cs b/Apps/Contoso.iOS.Puppet/ModulePages/DistributeController.cs
index 0c859924e..b522ad2bb 100644
--- a/Apps/Contoso.iOS.Puppet/ModulePages/DistributeController.cs
+++ b/Apps/Contoso.iOS.Puppet/ModulePages/DistributeController.cs
@@ -14,14 +14,14 @@ public DistributeController(IntPtr handle) : base(handle)
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
- DistributeEnabledSwitch.On = Distribute.Enabled;
- DistributeEnabledSwitch.Enabled = MobileCenter.Enabled;
+ DistributeEnabledSwitch.On = Distribute.IsEnabledAsync().Result;
+ DistributeEnabledSwitch.Enabled = MobileCenter.IsEnabledAsync().Result;
}
partial void UpdateEnabled()
{
- Distribute.Enabled = DistributeEnabledSwitch.On;
- DistributeEnabledSwitch.On = Distribute.Enabled;
+ Distribute.SetEnabledAsync(DistributeEnabledSwitch.On).Wait();
+ DistributeEnabledSwitch.On = Distribute.IsEnabledAsync().Result;
}
}
}
diff --git a/Apps/Contoso.iOS.Puppet/ModulePages/DistributeController.designer.cs b/Apps/Contoso.iOS.Puppet/ModulePages/DistributeController.designer.cs
index ecd2ea8ed..89016c448 100644
--- a/Apps/Contoso.iOS.Puppet/ModulePages/DistributeController.designer.cs
+++ b/Apps/Contoso.iOS.Puppet/ModulePages/DistributeController.designer.cs
@@ -1,29 +1,31 @@
// WARNING
//
-// This file has been generated automatically by Xamarin Studio to store outlets and
-// actions made in the UI designer. If it is removed, they will be lost.
-// Manual changes to this file may not be handled correctly.
+// This file has been generated automatically by Visual Studio from the outlets and
+// actions declared in your storyboard file.
+// Manual changes to this file will not be maintained.
//
using Foundation;
+using System;
using System.CodeDom.Compiler;
namespace Contoso.iOS.Puppet
{
- [Register ("DistributeController")]
- partial class DistributeController
- {
- [Outlet]
- UIKit.UISwitch DistributeEnabledSwitch { get; set; }
+ [Register ("DistributeController")]
+ partial class DistributeController
+ {
+ [Outlet]
+ UIKit.UISwitch DistributeEnabledSwitch { get; set; }
- [Action ("UpdateEnabled")]
- partial void UpdateEnabled ();
-
- void ReleaseDesignerOutlets ()
- {
- if (DistributeEnabledSwitch != null) {
- DistributeEnabledSwitch.Dispose ();
- DistributeEnabledSwitch = null;
- }
- }
- }
-}
+
+ [Action ("UpdateEnabled")]
+ partial void UpdateEnabled ();
+
+ void ReleaseDesignerOutlets ()
+ {
+ if (DistributeEnabledSwitch != null) {
+ DistributeEnabledSwitch.Dispose ();
+ DistributeEnabledSwitch = null;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Apps/Contoso.iOS.Puppet/ModulePages/MobileCenter.storyboard b/Apps/Contoso.iOS.Puppet/ModulePages/MobileCenter.storyboard
index fcc25c388..c48016b52 100644
--- a/Apps/Contoso.iOS.Puppet/ModulePages/MobileCenter.storyboard
+++ b/Apps/Contoso.iOS.Puppet/ModulePages/MobileCenter.storyboard
@@ -1,5 +1,5 @@
-
-
+
+
@@ -14,17 +14,17 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -229,14 +229,14 @@
-
+
-
+
-
+
@@ -246,14 +246,14 @@
-
+
-
+
-
+
@@ -263,14 +263,14 @@
-
+
-
+
-
+
@@ -280,14 +280,14 @@
-
+
-
+
-
+
@@ -312,8 +312,10 @@
+
+
-
+
\ No newline at end of file
diff --git a/Apps/Contoso.iOS.Puppet/ModulePages/MobileCenterController.cs b/Apps/Contoso.iOS.Puppet/ModulePages/MobileCenterController.cs
index 71b95adcc..c37d573d1 100644
--- a/Apps/Contoso.iOS.Puppet/ModulePages/MobileCenterController.cs
+++ b/Apps/Contoso.iOS.Puppet/ModulePages/MobileCenterController.cs
@@ -31,7 +31,7 @@ public MobileCenterController(IntPtr handle) : base(handle)
public override void ViewDidAppear(bool animated)
{
base.ViewDidAppear(animated);
- MobileCenterEnabledSwitch.On = MobileCenter.Enabled;
+ MobileCenterEnabledSwitch.On = MobileCenter.IsEnabledAsync().Result;
LogLevelLabel.Text = LogLevelNames[MobileCenter.LogLevel];
LogWriteLevelLabel.Text = LogLevelNames[mLogWriteLevel];
}
@@ -64,8 +64,8 @@ public override void PrepareForSegue(UIStoryboardSegue segue, NSObject sender)
partial void UpdateEnabled()
{
- MobileCenter.Enabled = MobileCenterEnabledSwitch.On;
- MobileCenterEnabledSwitch.On = MobileCenter.Enabled;
+ MobileCenter.SetEnabledAsync(MobileCenterEnabledSwitch.On).Wait();
+ MobileCenterEnabledSwitch.On = MobileCenter.IsEnabledAsync().Result;
}
partial void WriteLog()
diff --git a/Apps/Contoso.iOS.Puppet/TabBarController.designer.cs b/Apps/Contoso.iOS.Puppet/TabBarController.designer.cs
index ca0b190f6..4bcb6b729 100644
--- a/Apps/Contoso.iOS.Puppet/TabBarController.designer.cs
+++ b/Apps/Contoso.iOS.Puppet/TabBarController.designer.cs
@@ -1,6 +1,6 @@
-// WARNING
+// WARNING
//
-// This file has been generated automatically by Xamarin Studio from the outlets and
+// This file has been generated automatically by Visual Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
@@ -11,11 +11,11 @@
namespace Contoso.iOS.Puppet
{
- [Register("TabBarController")]
+ [Register ("TabBarController")]
partial class TabBarController
{
- void ReleaseDesignerOutlets()
+ void ReleaseDesignerOutlets ()
{
}
}
-}
+}
\ No newline at end of file
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android.Bindings/Properties/AssemblyInfo.cs
index b74870be8..af9005402 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android.Bindings/Properties/AssemblyInfo.cs
@@ -26,5 +26,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/MobileCenter.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/MobileCenter.cs
index 593cfcfd4..05c25ca0a 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/MobileCenter.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/MobileCenter.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using Android.App;
using Com.Microsoft.Azure.Mobile;
using Java.Lang;
@@ -8,24 +7,21 @@
namespace Microsoft.Azure.Mobile
{
using System.Reflection;
+ using System.Threading.Tasks;
+ using Com.Microsoft.Azure.Mobile.Utils.Async;
+ using Java.Util;
using AndroidWrapperSdk = Com.Microsoft.Azure.Mobile.Ingestion.Models.WrapperSdk;
- ///
- /// SDK core used to initialize, start and control specific service.
- ///
public partial class MobileCenter
{
/* The key identifier for parsing app secrets */
- private const string PlatformIdentifier = "android";
+ const string PlatformIdentifier = "android";
internal MobileCenter()
{
}
- ///
- /// This property controls the amount of logs emitted by the SDK.
- ///
- public static LogLevel LogLevel
+ static LogLevel PlatformLogLevel
{
get
{
@@ -84,19 +80,12 @@ public static LogLevel LogLevel
}
}
- ///
- /// Change the base URL (scheme + authority + port only) used to communicate with the backend.
- ///
- /// Base URL to use for server communication.
- public static void SetLogUrl(string logUrl)
+ static void PlatformSetLogUrl(string logUrl)
{
AndroidMobileCenter.SetLogUrl(logUrl);
}
- ///
- /// Check whether SDK has already been configured or not.
- ///
- public static bool Configured
+ static bool PlatformConfigured
{
get
{
@@ -104,40 +93,24 @@ public static bool Configured
}
}
- ///
- /// Configure the SDK.
- /// This may be called only once per application process lifetime.
- ///
- /// A unique and secret key used to identify the application.
- public static void Configure(string appSecret)
+ static void PlatformConfigure(string appSecret)
{
AndroidMobileCenter.Configure(SetWrapperSdkAndGetApplication(), appSecret);
}
- ///
- /// Start services.
- /// This may be called only once per service per application process lifetime.
- ///
- /// List of services to use.
- public static void Start(params Type[] services)
+ static void PlatformStart(params Type[] services)
{
AndroidMobileCenter.Start(GetServices(services));
}
- ///
- /// Initialize the SDK with the list of services to start.
- /// This may be called only once per application process lifetime.
- ///
- /// A unique and secret key used to identify the application.
- /// List of services to use.
- public static void Start(string appSecret, params Type[] services)
+ static void PlatformStart(string appSecret, params Type[] services)
{
string parsedSecret;
try
{
parsedSecret = GetSecretForPlatform(appSecret, PlatformIdentifier);
}
- catch (ArgumentException ex)
+ catch (MobileCenterException ex)
{
MobileCenterLog.Assert(MobileCenterLog.LogTag, ex.Message);
return;
@@ -145,36 +118,30 @@ public static void Start(string appSecret, params Type[] services)
AndroidMobileCenter.Start(SetWrapperSdkAndGetApplication(), parsedSecret, GetServices(services));
}
+ static Task PlatformIsEnabledAsync()
+ {
+ var future = AndroidMobileCenter.IsEnabled();
+ return Task.Run(() => (bool)future.Get());
+ }
- ///
- /// Enable or disable the SDK as a whole. Updating the property propagates the value to all services that have been started.
- ///
- ///
- /// The default state is true and updating the state is persisted into local application storage.
- ///
- public static bool Enabled
+ static Task PlatformSetEnabledAsync(bool enabled)
{
- get { return AndroidMobileCenter.Enabled; }
- set { AndroidMobileCenter.Enabled = value; }
+ var future = AndroidMobileCenter.SetEnabled(enabled);
+ return Task.Run(() => future.Get());
}
- ///
- /// Get the unique installation identifier for this application installation on this device.
- ///
- ///
- /// The identifier is lost if clearing application data or uninstalling application.
- ///
- public static Guid? InstallId
+ static Task PlatformGetInstallIdAsync()
{
- get
+ var future = AndroidMobileCenter.InstallId;
+ return Task.Run(() =>
{
- var installId = AndroidMobileCenter.InstallId;
+ var installId = future.Get() as UUID;
if (installId != null)
{
return Guid.Parse(installId.ToString());
}
- return null;
- }
+ return (Guid?)null;
+ });
}
static Application SetWrapperSdkAndGetApplication()
@@ -198,7 +165,7 @@ static Application SetWrapperSdkAndGetApplication()
return (Application)Application.Context;
}
- private static Class[] GetServices(IEnumerable services)
+ static Class[] GetServices(IEnumerable services)
{
var classes = new List();
foreach (var t in services)
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs
index 50fbda396..3b81397d2 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs
@@ -25,5 +25,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/MobileCenter.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/MobileCenter.cs
index cc11ae3da..9e53affb4 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/MobileCenter.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/MobileCenter.cs
@@ -1,7 +1,11 @@
using System;
+using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile
{
+ ///
+ /// SDK core used to initialize, start and control specific service.
+ ///
public partial class MobileCenter
{
// Gets the first instance of an app secret corresponding to the given platform name, or returns the string
@@ -51,6 +55,97 @@ internal static string GetSecretForPlatform(string secrets, string platformIdent
return platformSecret;
}
+ ///
+ /// This property controls the amount of logs emitted by the SDK.
+ ///
+ public static LogLevel LogLevel
+ {
+ get
+ {
+ return PlatformLogLevel;
+ }
+
+ set
+ {
+ PlatformLogLevel = value;
+ }
+ }
+
+ ///
+ /// Check whether the SDK is enabled or not as a whole.
+ ///
+ /// A task with result being true if enabled, false if disabled.
+ public static Task IsEnabledAsync()
+ {
+ return PlatformIsEnabledAsync();
+ }
+
+ ///
+ /// Enable or disable the SDK as a whole.
+ /// Updating the state propagates the value to all services that have been started.
+ ///
+ /// A task to monitor the operation.
+ public static Task SetEnabledAsync(bool enabled)
+ {
+ return PlatformSetEnabledAsync(enabled);
+ }
+
+ ///
+ /// Get the unique installation identifier for this application installation on this device.
+ ///
+ ///
+ /// The identifier is lost if clearing application data or uninstalling application.
+ ///
+ public static Task GetInstallIdAsync()
+ {
+ return PlatformGetInstallIdAsync();
+ }
+
+ ///
+ /// Change the base URL (scheme + authority + port only) used to communicate with the backend.
+ ///
+ /// Base URL to use for server communication.
+ public static void SetLogUrl(string logUrl)
+ {
+ PlatformSetLogUrl(logUrl);
+ }
+
+ ///
+ /// Check whether SDK has already been configured or not.
+ ///
+ public static bool Configured => PlatformConfigured;
+
+ ///
+ /// Configure the SDK.
+ /// This may be called only once per application process lifetime.
+ ///
+ /// A unique and secret key used to identify the application.
+ public static void Configure(string appSecret)
+ {
+ PlatformConfigure(appSecret);
+ }
+
+ ///
+ /// Start services.
+ /// This may be called only once per service per application process lifetime.
+ ///
+ /// List of services to use.
+ public static void Start(params Type[] services)
+ {
+ PlatformStart(services);
+ }
+
+ ///
+ /// Initialize the SDK with the list of services to start.
+ /// This may be called only once per application process lifetime.
+ ///
+ /// A unique and secret key used to identify the application.
+ /// List of services to use.
+ public static void Start(string appSecret, params Type[] services)
+ {
+ PlatformStart(appSecret, services);
+ }
+
///
/// Set the custom properties.
///
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs
index 772a4000e..f39fe7a62 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs
@@ -5,6 +5,6 @@ public static class WrapperSdk
public const string Name = "mobilecenter.xamarin";
/* We can't use reflection for assemblyInformationalVersion on iOS with "Link All" optimization. */
- internal const string Version = "0.13.1-SNAPSHOT";
+ internal const string Version = "0.14.0-SNAPSHOT";
}
}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Microsoft.Azure.Mobile.UWP.csproj b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Microsoft.Azure.Mobile.UWP.csproj
index fb8177830..1c76f93eb 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Microsoft.Azure.Mobile.UWP.csproj
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Microsoft.Azure.Mobile.UWP.csproj
@@ -161,9 +161,14 @@
+
+
+
+
+
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Properties/AssemblyInfo.cs
index b4b4d4783..b09bf8196 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Properties/AssemblyInfo.cs
@@ -25,7 +25,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("Microsoft.Azure.Mobile.Test.UWP")]
\ No newline at end of file
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DefaultScreenSizeProvider.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DefaultScreenSizeProvider.cs
new file mode 100644
index 000000000..d0034bc18
--- /dev/null
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DefaultScreenSizeProvider.cs
@@ -0,0 +1,90 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Windows.Foundation.Metadata;
+using Windows.Graphics.Display;
+
+namespace Microsoft.Azure.Mobile.Utils
+{
+ class DefaultScreenSizeProvider : ScreenSizeProviderBase
+ {
+ private readonly SemaphoreSlim _displayInformationEventSemaphore = new SemaphoreSlim(0);
+ private readonly object _lockObject = new object();
+
+ // Either of these == -1 translates to screen size of null.
+ private int _cachedScreenHeight = -1;
+ private int _cachedScreenWidth = -1;
+ private const string FailureMessage = "Could not determine display size.";
+
+ public DefaultScreenSizeProvider()
+ {
+ if (!ApiInformation.IsPropertyPresent(typeof(DisplayInformation).FullName, "ScreenHeightInRawPixels") ||
+ !ApiInformation.IsPropertyPresent(typeof(DisplayInformation).FullName, "ScreenWidthInRawPixels"))
+ {
+ MobileCenterLog.Warn(MobileCenterLog.LogTag, FailureMessage);
+ _displayInformationEventSemaphore.Release();
+ return;
+ }
+ try
+ {
+ // CurrentSynchronization context is essentially the UI context, which is needed
+ // to get display information. It isn't guaranteed to be available, so try/catch.
+ var context = TaskScheduler.FromCurrentSynchronizationContext();
+ Task.Factory.StartNew(() =>
+ {
+ var displayInfo = DisplayInformation.GetForCurrentView();
+ UpdateDisplayInformation((int)displayInfo.ScreenHeightInRawPixels, (int)displayInfo.ScreenWidthInRawPixels);
+ _displayInformationEventSemaphore.Release();
+
+ // Try to detect a change in screen size by attaching handlers to these events.
+ displayInfo.OrientationChanged += UpdateDisplayInformationHandler;
+ displayInfo.DpiChanged += UpdateDisplayInformationHandler;
+ displayInfo.ColorProfileChanged += UpdateDisplayInformationHandler;
+ }, new CancellationToken(), TaskCreationOptions.PreferFairness, context);
+ }
+ catch (InvalidOperationException)
+ {
+ _displayInformationEventSemaphore.Release();
+ MobileCenterLog.Warn(MobileCenterLog.LogTag, FailureMessage);
+ }
+ }
+
+ private void UpdateDisplayInformationHandler(DisplayInformation displayInfo, object e)
+ {
+ UpdateDisplayInformation((int)displayInfo.ScreenHeightInRawPixels, (int)displayInfo.ScreenWidthInRawPixels);
+ }
+
+ internal Task UpdateDisplayInformation(int newScreenHeight, int newScreenWidth)
+ {
+ lock (_lockObject)
+ {
+ var newHeight = newScreenHeight;
+ var newWidth = newScreenWidth;
+ var resolutionChanged = newHeight != _cachedScreenHeight || newWidth != _cachedScreenWidth;
+ _cachedScreenHeight = newHeight;
+ _cachedScreenWidth = newWidth;
+ if (resolutionChanged)
+ {
+ // Don't want to invoke this on the UI thread, so wrap in a task to be safe.
+ return Task.Run(() =>
+ {
+ ScreenSizeChanged?.Invoke(null, EventArgs.Empty);
+ });
+ }
+ return Task.CompletedTask;
+ }
+ }
+
+ public override int Height => _cachedScreenHeight;
+
+ public override int Width => _cachedScreenWidth;
+
+ public override async Task WaitUntilReadyAsync()
+ {
+ await _displayInformationEventSemaphore.WaitAsync().ConfigureAwait(false);
+ _displayInformationEventSemaphore.Release();
+ }
+
+ public override event EventHandler ScreenSizeChanged;
+ }
+}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DefaultScreenSizeProviderFactory.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DefaultScreenSizeProviderFactory.cs
new file mode 100644
index 000000000..f48607f31
--- /dev/null
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DefaultScreenSizeProviderFactory.cs
@@ -0,0 +1,10 @@
+namespace Microsoft.Azure.Mobile.Utils
+{
+ public class DefaultScreenSizeProviderFactory : IScreenSizeProviderFactory
+ {
+ public IScreenSizeProvider CreateScreenSizeProvider()
+ {
+ return new DefaultScreenSizeProvider();
+ }
+ }
+}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DeviceInformationHelper.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DeviceInformationHelper.cs
index c926a6938..42f75d57f 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DeviceInformationHelper.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/DeviceInformationHelper.cs
@@ -15,22 +15,22 @@ namespace Microsoft.Azure.Mobile.Utils
///
public class DeviceInformationHelper : AbstractDeviceInformationHelper
{
- private static string _cachedScreenSize = "unknown";
- private static bool _didSetUpScreenSizeEvent;
- private static readonly bool CanReadScreenSize;
public static event EventHandler InformationInvalidated;
- private static readonly object LockObject = new object();
private static string _country;
- private static readonly SemaphoreSlim DisplayInformationEventSemaphore = new SemaphoreSlim(0);
- private static readonly TimeSpan DisplayInformationTimeout = TimeSpan.FromSeconds(2);
+ private readonly IScreenSizeProvider _screenSizeProvider;
+ private static IScreenSizeProviderFactory _screenSizeProviderFactory =
+ new DefaultScreenSizeProviderFactory();
- public override async Task GetDeviceInformationAsync()
+ // This method must be called *before* any instance of DeviceInformationHelper has been created
+ // for a custom screen size provider to be used.
+ public static void SetScreenSizeProviderFactory(IScreenSizeProviderFactory factory)
{
- if (CanReadScreenSize)
- {
- await DisplayInformationEventSemaphore.WaitAsync(DisplayInformationTimeout).ConfigureAwait(false);
- }
+ _screenSizeProviderFactory = factory;
+ }
+ public override async Task GetDeviceInformationAsync()
+ {
+ await _screenSizeProvider.WaitUntilReadyAsync().ConfigureAwait(false);
return await base.GetDeviceInformationAsync().ConfigureAwait(false);
}
@@ -40,84 +40,13 @@ internal static void SetCountryCode(string country)
InformationInvalidated?.Invoke(null, EventArgs.Empty);
}
- static DeviceInformationHelper()
- {
- CanReadScreenSize =
- ApiInformation.IsPropertyPresent(typeof(DisplayInformation).FullName, "ScreenHeightInRawPixels") &&
- ApiInformation.IsPropertyPresent(typeof(DisplayInformation).FullName, "ScreenWidthInRawPixels");
-
- // This must all be done from the leaving background event because DisplayInformation can only be used
- // from the main thread
- if (CanReadScreenSize &&
- ApiInformation.IsEventPresent(typeof(CoreApplication).FullName, "LeavingBackground"))
- {
- CoreApplication.LeavingBackground += (sender, e) =>
- {
- lock (LockObject)
- {
- if (_didSetUpScreenSizeEvent)
- {
- return;
- }
- DisplayInformation.GetForCurrentView().OrientationChanged += (displayInfo, obj) =>
- {
- RefreshDisplayCache();
- };
- _didSetUpScreenSizeEvent = true;
- RefreshDisplayCache();
- DisplayInformationEventSemaphore.Release();
- }
- };
- }
- }
-
- public static void RetrieveDisplayInformation()
+ public DeviceInformationHelper()
{
- lock (LockObject)
+ _screenSizeProvider = _screenSizeProviderFactory.CreateScreenSizeProvider();
+ _screenSizeProvider.ScreenSizeChanged += (sender, e) =>
{
- if (_didSetUpScreenSizeEvent)
- {
- return;
- }
- DisplayInformation.GetForCurrentView().OrientationChanged += (displayInfo, obj) =>
- {
- RefreshDisplayCache();
- };
- _didSetUpScreenSizeEvent = true;
- RefreshDisplayCache();
- DisplayInformationEventSemaphore.Release();
- }
- }
-
- //NOTE: This method MUST be called from the UI thread
- public static void RefreshDisplayCache()
- {
- lock (LockObject)
- {
- DisplayInformation displayInfo = null;
- try
- {
- // This can throw exceptions that aren't well documented, so catch-all and ignore
- displayInfo = DisplayInformation.GetForCurrentView();
- }
- catch (Exception e)
- {
- MobileCenterLog.Warn(MobileCenterLog.LogTag, "Could not get display information.", e);
- return;
- }
- if (_cachedScreenSize == ScreenSizeFromDisplayInfo(displayInfo))
- {
- return;
- }
- _cachedScreenSize = ScreenSizeFromDisplayInfo(displayInfo);
- MobileCenterLog.Debug(MobileCenterLog.LogTag, $"Cached screen size updated to {_cachedScreenSize}");
- InformationInvalidated?.Invoke(null, EventArgs.Empty);
- }
- }
-
- private static string ScreenSizeFromDisplayInfo(DisplayInformation displayInfo)
- {
- return CanReadScreenSize ? $"{displayInfo.ScreenWidthInRawPixels}x{displayInfo.ScreenHeightInRawPixels}" : "unknown";
+ InformationInvalidated?.Invoke(sender, e);
+ };
}
protected override string GetSdkName()
@@ -185,10 +114,7 @@ protected override string GetAppBuild()
protected override string GetScreenSize()
{
- lock (LockObject)
- {
- return _cachedScreenSize;
- }
+ return _screenSizeProvider.ScreenSize;
}
protected override string GetCarrierCountry()
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/IScreenSizeProvider.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/IScreenSizeProvider.cs
new file mode 100644
index 000000000..312e4b1cd
--- /dev/null
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/IScreenSizeProvider.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Microsoft.Azure.Mobile.Utils
+{
+ ///
+ /// In most UWP apps, the DefaultScreenSizeProvider will do, but some
+ /// applications need to use different techniques to get the screen
+ /// size (e.g., Unity).
+ ///
+ public interface IScreenSizeProvider
+ {
+ // Format must be "{Width}x{Height}"
+ string ScreenSize { get; }
+
+ // Wait until screen size is available (or definitely unavailable)
+ Task WaitUntilReadyAsync();
+
+ // Indicates the screen resolution has changed
+ event EventHandler ScreenSizeChanged;
+ }
+}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/IScreenSizeProviderFactory.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/IScreenSizeProviderFactory.cs
new file mode 100644
index 000000000..9fbdd7ded
--- /dev/null
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/IScreenSizeProviderFactory.cs
@@ -0,0 +1,7 @@
+namespace Microsoft.Azure.Mobile.Utils
+{
+ public interface IScreenSizeProviderFactory
+ {
+ IScreenSizeProvider CreateScreenSizeProvider();
+ }
+}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/ScreenSizeProviderBase.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/ScreenSizeProviderBase.cs
new file mode 100644
index 000000000..652c473c2
--- /dev/null
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.UWP/Utils/ScreenSizeProviderBase.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Microsoft.Azure.Mobile.Utils
+{
+ public abstract class ScreenSizeProviderBase : IScreenSizeProvider
+ {
+ // Display height in pixels; -1 indicates unknown
+ public abstract int Height { get; }
+
+ // Display width in pixels; -1 indicates unkown
+ public abstract int Width { get; }
+
+ // Invoked when screen resolution changes (best-effort)
+ public abstract event EventHandler ScreenSizeChanged;
+
+ // Screen size
+ public string ScreenSize
+ {
+ get { return Height == -1 || Width == -1 ? null : $"{Width}x{Height}"; }
+ }
+
+ // Waits until the screen size is available (or definitely unavailable)
+ public abstract Task WaitUntilReadyAsync();
+ }
+}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/Channel.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/Channel.cs
index 085b70550..f45b6565b 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/Channel.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/Channel.cs
@@ -78,10 +78,10 @@ public bool IsEnabled
public event EventHandler FailedToSendLog;
#endregion
- public async Task SetEnabledAsync(bool enabled)
+ public void SetEnabled(bool enabled)
{
State state;
- using (await _mutex.GetLockAsync().ConfigureAwait(false))
+ using (_mutex.GetLock())
{
if (_enabled == enabled)
{
@@ -91,11 +91,11 @@ public async Task SetEnabledAsync(bool enabled)
}
if (enabled)
{
- await ResumeAsync(state).ConfigureAwait(false);
+ Resume(state);
}
else
{
- await SuspendAsync(state, true, new CancellationException()).ConfigureAwait(false);
+ Suspend(state, true, new CancellationException());
}
}
@@ -144,7 +144,7 @@ private async Task PersistLogAsync(Log log, State state)
{
try
{
- await _storage.PutLogAsync(Name, log).ConfigureAwait(false);
+ await _storage.PutLog(Name, log).ConfigureAwait(false);
}
catch (StorageException e)
{
@@ -161,7 +161,7 @@ private async Task PersistLogAsync(Log log, State state)
}
if (enabled)
{
- await CheckPendingLogsAsync(state).ConfigureAwait(false);
+ CheckPendingLogs(state);
return;
}
MobileCenterLog.Warn(MobileCenterLog.LogTag, "Channel is temporarily disabled; log was saved to disk");
@@ -183,7 +183,7 @@ public void InvalidateDeviceCache()
public async Task ClearAsync()
{
var state = _mutex.State;
- await _storage.DeleteLogsAsync(Name).ConfigureAwait(false);
+ await _storage.DeleteLogs(Name).ConfigureAwait(false);
try
{
using (await _mutex.GetLockAsync(state).ConfigureAwait(false))
@@ -197,11 +197,11 @@ public async Task ClearAsync()
}
}
- private async Task ResumeAsync(State state)
+ private void Resume(State state)
{
try
{
- using (await _mutex.GetLockAsync(state).ConfigureAwait(false))
+ using (_mutex.GetLock(state))
{
_enabled = true;
_discardLogs = false;
@@ -212,15 +212,15 @@ private async Task ResumeAsync(State state)
{
MobileCenterLog.Warn(MobileCenterLog.LogTag, "The Resume operation has been cancelled");
}
- await CheckPendingLogsAsync(state).ConfigureAwait(false);
+ CheckPendingLogs(state);
}
- private async Task SuspendAsync(State state, bool deleteLogs, Exception exception)
+ private void Suspend(State state, bool deleteLogs, Exception exception)
{
try
{
IEnumerable unsentLogs = null;
- using (await _mutex.GetLockAsync(state).ConfigureAwait(false))
+ using (_mutex.GetLock(state))
{
_enabled = false;
_batchScheduled = false;
@@ -249,13 +249,13 @@ private async Task SuspendAsync(State state, bool deleteLogs, Exception exceptio
{
MobileCenterLog.Error(MobileCenterLog.LogTag, "Failed to close ingestion", e);
}
- using (await _mutex.GetLockAsync(state).ConfigureAwait(false))
+ using (_mutex.GetLock(state))
{
_pendingLogCount = 0;
+ TriggerDeleteLogsOnSuspending();
}
- await DeleteLogsOnSuspendedAsync().ConfigureAwait(false);
}
- await _storage.ClearPendingLogStateAsync(Name).ConfigureAwait(false);
+ _storage.ClearPendingLogState(Name);
}
catch (StatefulMutexException)
{
@@ -263,43 +263,45 @@ private async Task SuspendAsync(State state, bool deleteLogs, Exception exceptio
}
}
- private async Task DeleteLogsOnSuspendedAsync()
+ private void TriggerDeleteLogsOnSuspending()
{
- try
+ if (SendingLog == null && FailedToSendLog == null)
{
- if (SendingLog != null || FailedToSendLog != null)
- {
- await SignalDeletingLogsAsync().ConfigureAwait(false);
- }
- }
- catch (StorageException)
- {
- MobileCenterLog.Warn(MobileCenterLog.LogTag, "Failed to invoke events for logs being deleted.");
+ _storage.DeleteLogs(Name);
return;
}
- await _storage.DeleteLogsAsync(Name).ConfigureAwait(false);
+ SignalDeletingLogs().ContinueWith(completedTask => _storage.DeleteLogs(Name));
}
- private async Task SignalDeletingLogsAsync()
+ private Task SignalDeletingLogs()
{
var logs = new List();
- await _storage.GetLogsAsync(Name, ClearBatchSize, logs).ConfigureAwait(false);
- foreach (var log in logs)
- {
- SendingLog?.Invoke(this, new SendingLogEventArgs(log));
- FailedToSendLog?.Invoke(this, new FailedToSendLogEventArgs(log, new CancellationException()));
- }
- if (logs.Count >= ClearBatchSize)
- {
- await SignalDeletingLogsAsync().ConfigureAwait(false);
- }
+ return _storage.GetLogsAsync(Name, ClearBatchSize, logs)
+ .ContinueWith(completedTask =>
+ {
+ if (completedTask.IsFaulted)
+ {
+ MobileCenterLog.Warn(MobileCenterLog.LogTag,
+ "Failed to invoke events for logs being deleted.");
+ return;
+ }
+ foreach (var log in logs)
+ {
+ SendingLog?.Invoke(this, new SendingLogEventArgs(log));
+ FailedToSendLog?.Invoke(this, new FailedToSendLogEventArgs(log, new CancellationException()));
+ }
+ if (logs.Count >= ClearBatchSize)
+ {
+ SignalDeletingLogs();
+ }
+ });
}
private async Task TriggerIngestionAsync(State state)
{
using (await _mutex.GetLockAsync(state).ConfigureAwait(false))
{
- if (!_enabled)
+ if (!_enabled || !_batchScheduled)
{
return;
}
@@ -326,8 +328,8 @@ private async Task TriggerIngestionAsync(State state)
}
try
{
- await TriggerIngestionAsync(state, logs, batchId).ConfigureAwait(false);
- await CheckPendingLogsAsync(state).ConfigureAwait(false);
+ TriggerIngestion(state, logs, batchId);
+ CheckPendingLogs(state);
}
catch (StorageException)
{
@@ -336,7 +338,7 @@ private async Task TriggerIngestionAsync(State state)
}
}
- private async Task TriggerIngestionAsync(State state, IList logs, string batchId)
+ private void TriggerIngestion(State state, IList logs, string batchId)
{
// Before sending logs, trigger the sending event for this channel
if (SendingLog != null)
@@ -348,23 +350,27 @@ private async Task TriggerIngestionAsync(State state, IList logs, string ba
}
// If the optional Install ID has no value, default to using empty GUID
- var installId = MobileCenter.InstallId.HasValue ? MobileCenter.InstallId.Value : Guid.Empty;
+ // TODO When InstallId will really be async, we should not use Result anymore
+ var rawInstallId = MobileCenter.GetInstallIdAsync().Result;
+ var installId = rawInstallId.HasValue ? rawInstallId.Value : Guid.Empty;
using (var serviceCall = _ingestion.PrepareServiceCall(_appSecret, installId, logs))
{
- try
+ serviceCall.ExecuteAsync().ContinueWith(completedTask =>
{
- await serviceCall.ExecuteAsync().ConfigureAwait(false);
- }
- catch (IngestionException exception)
- {
- await HandleSendingFailureAsync(state, batchId, exception).ConfigureAwait(false);
- return;
- }
+ var ingestionException = completedTask.Exception?.InnerException as IngestionException;
+ if (ingestionException == null)
+ {
+ HandleSendingSuccess(state, batchId);
+ }
+ else
+ {
+ HandleSendingFailure(state, batchId, ingestionException);
+ }
+ });
}
- await HandleSendingSuccessAsync(state, batchId).ConfigureAwait(false);
}
- private async Task HandleSendingSuccessAsync(State state, string batchId)
+ private void HandleSendingSuccess(State state, string batchId)
{
if (!_mutex.IsCurrent(state))
{
@@ -372,7 +378,7 @@ private async Task HandleSendingSuccessAsync(State state, string batchId)
}
try
{
- await _storage.DeleteLogsAsync(Name, batchId).ConfigureAwait(false);
+ _storage.DeleteLogs(Name, batchId);
}
catch (StorageException e)
{
@@ -382,7 +388,7 @@ private async Task HandleSendingSuccessAsync(State state, string batchId)
finally
{
List removedLogs;
- using (await _mutex.GetLockAsync(state).ConfigureAwait(false))
+ using (_mutex.GetLock(state))
{
removedLogs = _sendingBatches[batchId];
_sendingBatches.Remove(batchId);
@@ -397,12 +403,12 @@ private async Task HandleSendingSuccessAsync(State state, string batchId)
}
}
- private async Task HandleSendingFailureAsync(State state, string batchId, IngestionException e)
+ private void HandleSendingFailure(State state, string batchId, IngestionException e)
{
var isRecoverable = e?.IsRecoverable ?? false;
MobileCenterLog.Error(MobileCenterLog.LogTag, $"Sending logs for channel '{Name}', batch '{batchId}' failed: {e?.Message}");
List removedLogs;
- using (await _mutex.GetLockAsync(state).ConfigureAwait(false))
+ using (_mutex.GetLock(state))
{
removedLogs = _sendingBatches[batchId];
_sendingBatches.Remove(batchId);
@@ -418,10 +424,10 @@ private async Task HandleSendingFailureAsync(State state, string batchId, Ingest
FailedToSendLog?.Invoke(this, new FailedToSendLogEventArgs(log, e));
}
}
- await SuspendAsync(state, !isRecoverable, e).ConfigureAwait(false);
+ Suspend(state, !isRecoverable, e);
}
- private async Task CheckPendingLogsAsync(State state)
+ private void CheckPendingLogs(State state)
{
if (!_enabled)
{
@@ -430,29 +436,39 @@ private async Task CheckPendingLogsAsync(State state)
}
MobileCenterLog.Debug(MobileCenterLog.LogTag, $"CheckPendingLogs({Name}) pending log count: {_pendingLogCount}");
- if (_pendingLogCount >= _maxLogsPerBatch)
- {
- await TriggerIngestionAsync(state).ConfigureAwait(false);
- }
- else if (_pendingLogCount > 0 && !_batchScheduled)
+ using (_mutex.GetLock())
{
- _batchScheduled = true;
-
- // No need wait _batchTimeInterval here.
- var _ = Task.Run(async () =>
+ if (_pendingLogCount >= _maxLogsPerBatch)
{
- await Task.Delay((int)_batchTimeInterval.TotalMilliseconds).ConfigureAwait(false);
- if (_batchScheduled)
+ _batchScheduled = true;
+ Task.Run(async () =>
{
- await TriggerIngestionAsync(_mutex.State).ConfigureAwait(false);
- }
- });
+ await TriggerIngestionAsync(state).ConfigureAwait(false);
+ });
+ }
+ else if (_pendingLogCount > 0 && !_batchScheduled)
+ {
+ _batchScheduled = true;
+
+ // No need wait _batchTimeInterval here.
+ Task.Run(async () =>
+ {
+ await Task.Delay((int) _batchTimeInterval.TotalMilliseconds).ConfigureAwait(false);
+ if (_batchScheduled)
+ {
+ await TriggerIngestionAsync(_mutex.State).ConfigureAwait(false);
+ }
+ });
+ }
}
}
public Task ShutdownAsync()
{
- return SuspendAsync(_mutex.State, false, new CancellationException());
+ Suspend(_mutex.State, false, new CancellationException());
+
+ // Nothing to wait on; just suspend and return a task
+ return Task.FromResult(default(object));
}
public void Dispose()
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/ChannelGroup.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/ChannelGroup.cs
index 87eeaa4eb..2d4f2eb5b 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/ChannelGroup.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/ChannelGroup.cs
@@ -77,18 +77,16 @@ public void AddChannel(IChannelUnit channel)
}
}
- public Task SetEnabledAsync(bool enabled)
+ public void SetEnabled(bool enabled)
{
ThrowIfDisposed();
- var tasks = new List();
lock (_channelGroupLock)
{
foreach (var channel in _channels)
{
- tasks.Add(channel.SetEnabledAsync(enabled));
+ channel.SetEnabled(enabled);
}
}
- return Task.WhenAll(tasks);
}
public async Task ShutdownAsync()
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/IChannel.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/IChannel.cs
index 07196ca97..fd6f308d3 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/IChannel.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Channel/IChannel.cs
@@ -32,7 +32,7 @@ public interface IChannel : IDisposable
/// Enable or disable the channel
///
/// Value indicating whether channel should be enabled or disabled
- Task SetEnabledAsync(bool enabled);
+ void SetEnabled(bool enabled);
///
/// Stop all calls in progress and deactivate this channel
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/MobileCenter.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/MobileCenter.cs
index fb2167840..d0aec19b4 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/MobileCenter.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/MobileCenter.cs
@@ -5,6 +5,7 @@
using Microsoft.Azure.Mobile.Ingestion.Models;
using Microsoft.Azure.Mobile.Utils;
using Microsoft.Azure.Mobile.Ingestion.Models.Serialization;
+using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile
{
@@ -32,7 +33,7 @@ public partial class MobileCenter
private string _logUrl;
private bool _instanceConfigured;
private string _appSecret;
-
+
#region static
// The shared instance of MobileCenter
@@ -60,10 +61,7 @@ internal static MobileCenter Instance
}
}
- ///
- /// Controls the amount of logs emitted by the SDK.
- ///
- public static LogLevel LogLevel
+ static LogLevel PlatformLogLevel
{
get
{
@@ -81,44 +79,31 @@ public static LogLevel LogLevel
}
}
- ///
- /// Enable or disable the SDK as a whole. Updating the property propagates the value to all services that have been
- /// started.
- ///
- ///
- /// The default state is true and updating the state is persisted into local application storage.
- ///
- public static bool Enabled
+ static Task PlatformIsEnabledAsync()
{
- get
+ // This is not really async for now, signature was introduced for Android
+ // It's fine for callers of the current implementation to use Wait().
+ lock (MobileCenterLock)
{
- lock (MobileCenterLock)
- {
- return Instance.InstanceEnabled;
- }
+ return Task.FromResult(Instance.InstanceEnabled);
}
- set
+ }
+
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ lock (MobileCenterLock)
{
- lock (MobileCenterLock)
- {
- Instance.InstanceEnabled = value;
- }
+ Instance.InstanceEnabled = enabled;
+ return Task.FromResult(default(object));
}
}
- ///
- /// Get the unique installation identifier for this application installation on this device.
- ///
- ///
- /// The identifier is lost if clearing application data or uninstalling application.
- ///
- public static Guid? InstallId => Instance._applicationSettings.GetValue(InstallIdKey, Guid.NewGuid());
+ static Task PlatformGetInstallIdAsync()
+ {
+ return Task.FromResult((Guid?)Instance._applicationSettings.GetValue(InstallIdKey, Guid.NewGuid()));
+ }
- ///
- /// Change the base URL (scheme + authority + port only) used to communicate with the backend.
- ///
- /// Base URL to use for server communication.
- public static void SetLogUrl(string logUrl)
+ static void PlatformSetLogUrl(string logUrl)
{
lock (MobileCenterLock)
{
@@ -134,10 +119,7 @@ internal static void PlatformSetCustomProperties(CustomProperties customProperti
}
}
- ///
- /// Check whether SDK has already been configured or not.
- ///
- public static bool Configured
+ static bool PlatformConfigured
{
get
{
@@ -148,12 +130,7 @@ public static bool Configured
}
}
- ///
- /// Configure the SDK.
- /// This may be called only once per application process lifetime.
- ///
- /// A unique and secret key used to identify the application.
- public static void Configure(string appSecret)
+ static void PlatformConfigure(string appSecret)
{
lock (MobileCenterLock)
{
@@ -168,12 +145,7 @@ public static void Configure(string appSecret)
}
}
- ///
- /// Start services.
- /// This may be called only once per service per application process lifetime.
- ///
- /// List of services to use.
- public static void Start(params Type[] services)
+ static void PlatformStart(params Type[] services)
{
lock (MobileCenterLock)
{
@@ -188,13 +160,7 @@ public static void Start(params Type[] services)
}
}
- ///
- /// Initialize the SDK with the list of services to start.
- /// This may be called only once per application process lifetime.
- ///
- /// A unique and secret key used to identify the application.
- /// List of services to use.
- public static void Start(string appSecret, params Type[] services)
+ static void PlatformStart(string appSecret, params Type[] services)
{
lock (MobileCenterLock)
{
@@ -236,7 +202,7 @@ private bool InstanceEnabled
return;
}
- _channelGroup?.SetEnabledAsync(value);
+ _channelGroup?.SetEnabled(value);
_applicationSettings[EnabledKey] = value;
foreach (var service in _services)
@@ -255,6 +221,11 @@ private void SetInstanceLogUrl(string logUrl)
private void SetInstanceCustomProperties(CustomProperties customProperties)
{
+ if (!Configured)
+ {
+ MobileCenterLog.Error(MobileCenterLog.LogTag, "Mobile Center hasn't been configured. You need to call MobileCenter.Start with appSecret or MobileCenter.Configure first.");
+ return;
+ }
if (customProperties == null || customProperties.Properties.Count == 0)
{
MobileCenterLog.Error(MobileCenterLog.LogTag, "Custom properties may not be null or empty");
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/MobileCenterService.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/MobileCenterService.cs
index f7913b9ad..59a6a2f1b 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/MobileCenterService.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/MobileCenterService.cs
@@ -86,7 +86,7 @@ public virtual bool InstanceEnabled
lock (_serviceLock)
{
var enabledString = value ? "enabled" : "disabled";
- if (value && !MobileCenter.Enabled)
+ if (value && !MobileCenter.IsEnabledAsync().Result)
{
MobileCenterLog.Error(LogTag,
"The SDK is disabled. Set MobileCenter.Enabled to 'true' before enabling a specific service.");
@@ -97,7 +97,7 @@ public virtual bool InstanceEnabled
MobileCenterLog.Info(LogTag, $"{ServiceName} service has already been {enabledString}.");
return;
}
- Channel?.SetEnabledAsync(value);
+ Channel?.SetEnabled(value);
_applicationSettings[EnabledPreferenceKey] = value;
MobileCenterLog.Info(LogTag, $"{ServiceName} service has been {enabledString}");
}
@@ -116,9 +116,9 @@ public virtual void OnChannelGroupReady(IChannelGroup channelGroup, string appSe
{
ChannelGroup = channelGroup;
Channel = channelGroup.AddChannel(ChannelName, TriggerCount, TriggerInterval, TriggerMaxParallelRequests);
- var enabled = MobileCenter.Enabled && InstanceEnabled;
+ var enabled = MobileCenter.IsEnabledAsync().Result && InstanceEnabled;
_applicationSettings[EnabledPreferenceKey] = enabled;
- Channel.SetEnabledAsync(enabled);
+ Channel.SetEnabled(enabled);
}
}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Storage/IStorage.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Storage/IStorage.cs
index 2183d2cad..d0c4df69e 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Storage/IStorage.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Storage/IStorage.cs
@@ -7,11 +7,11 @@ namespace Microsoft.Azure.Mobile.Storage
{
public interface IStorage : IDisposable
{
- Task PutLogAsync(string channelName, Log log);
- Task DeleteLogsAsync(string channelName, string batchId);
- Task DeleteLogsAsync(string channelName);
+ Task PutLog(string channelName, Log log);
+ Task DeleteLogs(string channelName, string batchId);
+ Task DeleteLogs(string channelName);
Task CountLogsAsync(string channelName);
- Task ClearPendingLogStateAsync(string channelName);
+ Task ClearPendingLogState(string channelName);
Task GetLogsAsync(string channelName, int limit, List logs);
Task ShutdownAsync(TimeSpan timeout);
}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Storage/Storage.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Storage/Storage.cs
index 7f05543b2..f8c700759 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Storage/Storage.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Storage/Storage.cs
@@ -52,7 +52,7 @@ internal Storage(IStorageAdapter adapter)
{
_storageAdapter = adapter;
_queue.Add(new Task(() => InitializeDatabaseAsync().Wait()));
- _queueFlushTask = Task.Run(FlushQueue);
+ _queueFlushTask = Task.Run(FlushQueueAsync);
}
///
@@ -61,7 +61,7 @@ internal Storage(IStorageAdapter adapter)
/// The name of the channel associated with the log
/// The log to add
///
- public async Task PutLogAsync(string channelName, Log log)
+ public Task PutLog(string channelName, Log log)
{
var task = new Task(() =>
{
@@ -78,7 +78,7 @@ public async Task PutLogAsync(string channelName, Log log)
throw new StorageException("The operation has been cancelled");
}
_flushSemaphore.Release();
- await task.ConfigureAwait(false);
+ return task;
}
///
@@ -87,7 +87,7 @@ public async Task PutLogAsync(string channelName, Log log)
/// The name of the channel associated with the batch
/// The batch identifier
///
- public async Task DeleteLogsAsync(string channelName, string batchId)
+ public Task DeleteLogs(string channelName, string batchId)
{
var task = new Task(() =>
{
@@ -125,7 +125,7 @@ public async Task DeleteLogsAsync(string channelName, string batchId)
throw new StorageException("The operation has been cancelled");
}
_flushSemaphore.Release();
- await task.ConfigureAwait(false);
+ return task;
}
///
@@ -133,7 +133,7 @@ public async Task DeleteLogsAsync(string channelName, string batchId)
///
/// Name of the channel to delete logs for
///
- public async Task DeleteLogsAsync(string channelName)
+ public Task DeleteLogs(string channelName)
{
var task = new Task(() =>
{
@@ -141,7 +141,7 @@ public async Task DeleteLogsAsync(string channelName)
{
MobileCenterLog.Debug(MobileCenterLog.LogTag,
$"Deleting all logs from storage for channel '{channelName}'");
- ClearPendingLogState(channelName);
+ ClearPendingLogStateWithoutEnqueue(channelName);
_storageAdapter.DeleteAsync(entry => entry.Channel == channelName)
.Wait();
}
@@ -159,7 +159,7 @@ public async Task DeleteLogsAsync(string channelName)
throw new StorageException("The operation has been cancelled");
}
_flushSemaphore.Release();
- await task.ConfigureAwait(false);
+ return task;
}
///
@@ -191,11 +191,11 @@ public async Task CountLogsAsync(string channelName)
/// Asynchronously clears the stored state of logs that have been retrieved
///
///
- public async Task ClearPendingLogStateAsync(string channelName)
+ public Task ClearPendingLogState(string channelName)
{
var task = new Task(() =>
{
- ClearPendingLogState(channelName);
+ ClearPendingLogStateWithoutEnqueue(channelName);
MobileCenterLog.Debug(MobileCenterLog.LogTag, $"Clear pending log states for channel {channelName}");
});
try
@@ -207,10 +207,10 @@ public async Task ClearPendingLogStateAsync(string channelName)
throw new StorageException("The operation has been cancelled");
}
_flushSemaphore.Release();
- await task.ConfigureAwait(false);
+ return task;
}
- private void ClearPendingLogState(string channelName)
+ private void ClearPendingLogStateWithoutEnqueue(string channelName)
{
var fullIdentifiers = new List();
@@ -364,7 +364,7 @@ private static bool ChannelMatchesIdentifier(string channelName, string identifi
}
// Flushes the queue
- private async Task FlushQueue()
+ private async Task FlushQueueAsync()
{
while (true)
{
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Utils/Synchronization/StatefulMutex.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Utils/Synchronization/StatefulMutex.cs
index b2e769134..143e690aa 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Utils/Synchronization/StatefulMutex.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Windows.Shared/Utils/Synchronization/StatefulMutex.cs
@@ -42,13 +42,24 @@ public bool IsCurrent(State state)
{
return _state.Equals(state);
}
-
+
public LockHolder GetLock()
{
_mutex.Wait();
return new LockHolder(this);
}
+ public LockHolder GetLock(State state)
+ {
+ _mutex.Wait();
+ if (IsCurrent(state))
+ {
+ return new LockHolder(this);
+ }
+ _mutex.Release();
+ throw new StatefulMutexException("Cannot lock mutex with expired state");
+ }
+
public async Task GetLockAsync()
{
await _mutex.WaitAsync().ConfigureAwait(false);
@@ -58,12 +69,12 @@ public async Task GetLockAsync()
public async Task GetLockAsync(State state)
{
await _mutex.WaitAsync().ConfigureAwait(false);
- if (!IsCurrent(state))
+ if (IsCurrent(state))
{
- _mutex.Release();
- throw new StatefulMutexException("Cannot lock mutex with expired state");
+ return new LockHolder(this);
}
- return new LockHolder(this);
+ _mutex.Release();
+ throw new StatefulMutexException("Cannot lock mutex with expired state");
}
///
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/ApiDefinition.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/ApiDefinition.cs
index 9a382a1f8..7ac01f955 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/ApiDefinition.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/ApiDefinition.cs
@@ -131,23 +131,23 @@ interface MSCustomProperties
{
// - (instancetype)setString:(NSString *)value forKey:(NSString *)key;
[Export("setString:forKey:")]
- void Set(string value, string key);
+ void Set([NullAllowed] string value, [NullAllowed] string key);
// - (instancetype)setNumber:(NSNumber *)value forKey:(NSString *)key;
[Export("setNumber:forKey:")]
- void Set(NSNumber value, string key);
+ void Set(NSNumber value, [NullAllowed] string key);
// - (instancetype)setBool:(BOOL)value forKey:(NSString *)key;
[Export("setBool:forKey:")]
- void Set(bool value, string key);
+ void Set(bool value, [NullAllowed] string key);
// - (instancetype)setDate:(NSDate *)value forKey:(NSString *)key;
[Export("setDate:forKey:")]
- void Set(NSDate value, string key);
+ void Set(NSDate value, [NullAllowed] string key);
// - (instancetype)clearPropertyForKey:(NSString *)key;
[Export("clearPropertyForKey:")]
- void Clear(string key);
+ void Clear([NullAllowed] string key);
}
// @interface MSMobileCenter : NSObject
@@ -162,12 +162,12 @@ interface MSMobileCenter
// +(void)configureWithAppSecret:(NSString *)appSecret;
[Static]
[Export("configureWithAppSecret:")]
- void ConfigureWithAppSecret(string appSecret);
+ void ConfigureWithAppSecret([NullAllowed] string appSecret);
// +(void)start:(NSString *)appSecret withServices:(NSArray *)services;
[Static]
[Export("start:withServices:")]
- void Start(string appSecret, Class[] services);
+ void Start([NullAllowed] string appSecret, Class[] services);
// +(void)startService:(Class)service;
[Static]
@@ -182,7 +182,7 @@ interface MSMobileCenter
// +(void)setLogUrl:(NSString *)setLogUrl;
[Static]
[Export("setLogUrl:")]
- void SetLogUrl(string logUrl);
+ void SetLogUrl([NullAllowed] string logUrl);
// +(void)setEnabled:(BOOL)isEnabled;
[Static]
@@ -227,7 +227,7 @@ interface MSMobileCenter
// + (void)setCustomProperties:(MSCustomProperties *)customProperties;
[Static]
[Export("setCustomProperties:")]
- void SetCustomProperties(MSCustomProperties properties);
+ void SetCustomProperties([NullAllowed] MSCustomProperties properties);
}
// @protocol MSService
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj
index aca675941..1e1f1e395 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj
@@ -60,6 +60,8 @@
Static
True
+
+ -lsqlite3
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Properties/AssemblyInfo.cs
index 07ad4caf2..7f0da6d51 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Properties/AssemblyInfo.cs
@@ -31,5 +31,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/MobileCenter.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/MobileCenter.cs
index 0255bd6a1..baca8c260 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/MobileCenter.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/MobileCenter.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Threading.Tasks;
using ObjCRuntime;
namespace Microsoft.Azure.Mobile
@@ -8,9 +9,6 @@ namespace Microsoft.Azure.Mobile
using iOSMobileCenter = Microsoft.Azure.Mobile.iOS.Bindings.MSMobileCenter;
using iOSWrapperSdk = Microsoft.Azure.Mobile.iOS.Bindings.MSWrapperSdk;
- ///
- /// SDK core used to initialize, start and control specific service.
- ///
public partial class MobileCenter
{
/* The key identifier for parsing app secrets */
@@ -20,10 +18,7 @@ internal MobileCenter()
{
}
- ///
- /// This property controls the amount of logs emitted by the SDK.
- ///
- public static LogLevel LogLevel
+ static LogLevel PlatformLogLevel
{
get
{
@@ -81,19 +76,12 @@ public static LogLevel LogLevel
}
}
- ///
- /// Change the base URL (scheme + authority + port only) used to communicate with the backend.
- ///
- /// Base URL to use for server communication.
- public static void SetLogUrl(string logUrl)
+ static void PlatformSetLogUrl(string logUrl)
{
iOSMobileCenter.SetLogUrl(logUrl);
}
- ///
- /// Check whether SDK has already been configured or not.
- ///
- public static bool Configured
+ static bool PlatformConfigured
{
get
{
@@ -101,23 +89,13 @@ public static bool Configured
}
}
- ///
- /// Configure the SDK.
- /// This may be called only once per application process lifetime.
- ///
- /// A unique and secret key used to identify the application.
- public static void Configure(string appSecret)
+ static void PlatformConfigure(string appSecret)
{
SetWrapperSdk();
iOSMobileCenter.ConfigureWithAppSecret(appSecret);
}
- ///
- /// Start services.
- /// This may be called only once per service per application process lifetime.
- ///
- /// List of services to use.
- public static void Start(params Type[] services)
+ static void PlatformStart(params Type[] services)
{
SetWrapperSdk();
foreach (var service in GetServices(services))
@@ -126,13 +104,7 @@ public static void Start(params Type[] services)
}
}
- ///
- /// Initialize the SDK with the list of services to start.
- /// This may be called only once per application process lifetime.
- ///
- /// A unique and secret key used to identify the application.
- /// List of services to use.
- public static void Start(string appSecret, params Type[] services)
+ static void PlatformStart(string appSecret, params Type[] services)
{
SetWrapperSdk();
string parsedSecret;
@@ -140,7 +112,7 @@ public static void Start(string appSecret, params Type[] services)
{
parsedSecret = GetSecretForPlatform(appSecret, PlatformIdentifier);
}
- catch (ArgumentException ex)
+ catch (MobileCenterException ex)
{
MobileCenterLog.Assert(MobileCenterLog.LogTag, ex.Message);
return;
@@ -148,25 +120,22 @@ public static void Start(string appSecret, params Type[] services)
iOSMobileCenter.Start(parsedSecret, GetServices(services));
}
- ///
- /// Enable or disable the SDK as a whole. Updating the property propagates the value to all services that have been started.
- ///
- ///
- /// The default state is true and updating the state is persisted into local application storage.
- ///
- public static bool Enabled
+ static Task PlatformIsEnabledAsync()
{
- get { return iOSMobileCenter.IsEnabled(); }
- set { iOSMobileCenter.SetEnabled(value); }
+ return Task.FromResult(iOSMobileCenter.IsEnabled());
}
- ///
- /// Get the unique installation identifier for this application installation on this device.
- ///
- ///
- /// The identifier is lost if clearing application data or uninstalling application.
- ///
- public static Guid? InstallId => Guid.Parse(iOSMobileCenter.InstallId().AsString());
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ iOSMobileCenter.SetEnabled(enabled);
+ return Task.FromResult(default(object));
+ }
+
+ static Task PlatformGetInstallIdAsync()
+ {
+ Guid? installId = Guid.Parse(iOSMobileCenter.InstallId().AsString());
+ return Task.FromResult(installId);
+ }
static Class[] GetServices(IEnumerable services)
{
@@ -209,7 +178,7 @@ static void SetWrapperSdk()
static void PlatformSetCustomProperties(CustomProperties customProperties)
{
- iOSMobileCenter.SetCustomProperties(customProperties.IOSCustomProperties);
+ iOSMobileCenter.SetCustomProperties(customProperties?.IOSCustomProperties);
}
}
}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs
index 41c45d79e..14ccb44c7 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs
@@ -23,5 +23,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile/MobileCenter.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile/MobileCenter.cs
index 1f52acebc..f15641ff2 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile/MobileCenter.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile/MobileCenter.cs
@@ -2,12 +2,10 @@
using System;
using System.Diagnostics;
+using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile
{
- ///
- /// SDK core used to initialize, start and control specific service.
- ///
public partial class MobileCenter
{
internal MobileCenter()
@@ -15,70 +13,43 @@ internal MobileCenter()
}
/* Error message to display for unsupported targets. */
- private const string ErrorMessage =
+ const string ErrorMessage =
"[MobileCenter] ASSERT: Cannot use Mobile Center on this target. If you are on Android or iOS or UWP, you must add the NuGet packages in the Android and iOS and UWP projects as well. Other targets are not yet supported.";
- ///
- /// This property controls the amount of logs emitted by the SDK.
- ///
- public static LogLevel LogLevel { get; set; }
- ///
- /// Enable or disable the SDK as a whole. Updating the property propagates the value to all services that have been
- /// started.
- ///
- ///
- /// The default state is true and updating the state is persisted into local application storage.
- ///
- public static bool Enabled { get; set; }
+ static LogLevel PlatformLogLevel { get; set; }
- ///
- /// Get the unique installation identifier for this application installation on this device.
- ///
- ///
- /// The identifier is lost if clearing application data or uninstalling application.
- ///
- public static Guid? InstallId { get; }
+ static Task PlatformIsEnabledAsync()
+ {
+ return Task.FromResult(false);
+ }
+
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ return Task.FromResult(default(object));
+ }
+
+ static Task PlatformGetInstallIdAsync()
+ {
+ return Task.FromResult((Guid?)null);
+ }
- ///
- /// Change the base URL (scheme + authority + port only) used to communicate with the backend.
- ///
- /// Base URL to use for server communication.
- public static void SetLogUrl(string logUrl)
+ static void PlatformSetLogUrl(string logUrl)
{
}
- ///
- /// Check whether SDK has already been configured or not.
- ///
- public static bool Configured { get; }
+ static bool PlatformConfigured { get; }
- ///
- /// Configure the SDK.
- /// This may be called only once per application process lifetime.
- ///
- /// A unique and secret key used to identify the application.
- public static void Configure(string appSecret)
+ static void PlatformConfigure(string appSecret)
{
Debug.WriteLine(ErrorMessage);
}
- ///
- /// Start services.
- /// This may be called only once per service per application process lifetime.
- ///
- /// List of services to use.
- public static void Start(params Type[] services)
+ static void PlatformStart(params Type[] services)
{
Debug.WriteLine(ErrorMessage);
}
- ///
- /// Initialize the SDK with the list of services to start.
- /// This may be called only once per application process lifetime.
- ///
- /// A unique and secret key used to identify the application.
- /// List of services to use.
- public static void Start(string appSecret, params Type[] services)
+ static void PlatformStart(string appSecret, params Type[] services)
{
Debug.WriteLine(ErrorMessage);
}
diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs
index e6d064e6d..54a8c9b55 100644
--- a/SDK/MobileCenter/Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenter/Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs
@@ -25,5 +25,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android.Bindings/Properties/AssemblyInfo.cs
index c580c41bf..bb7f851c5 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android.Bindings/Properties/AssemblyInfo.cs
@@ -18,8 +18,8 @@
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Analytics.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Analytics.cs
index 9072c6eee..b6838d7c9 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Analytics.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Analytics.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Threading.Tasks;
using Android.Runtime;
using Com.Microsoft.Azure.Mobile.Analytics;
@@ -24,12 +25,23 @@ internal Analytics()
public static Type BindingType => typeof(AndroidAnalytics);
///
- /// Enable or disable Analytics module.
+ /// Check whether the Analytics service is enabled or not.
///
- public static bool Enabled
+ /// A task with result being true if enabled, false if disabled.
+ public static Task IsEnabledAsync()
{
- get { return AndroidAnalytics.Enabled; }
- set { AndroidAnalytics.Enabled = value; }
+ var future = AndroidAnalytics.IsEnabled();
+ return Task.Run(() => (bool)future.Get());
+ }
+
+ ///
+ /// Enable or disable the Analytics service.
+ ///
+ /// A task to monitor the operation.
+ public static Task SetEnabledAsync(bool enabled)
+ {
+ var future = AndroidAnalytics.SetEnabled(enabled);
+ return Task.Run(() => future.Get());
}
/////
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Properties/AssemblyInfo.cs
index 76d61aca7..128b9c60a 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Properties/AssemblyInfo.cs
@@ -25,5 +25,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.UWP/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.UWP/Properties/AssemblyInfo.cs
index de11fcf6d..8cdeb3a09 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.UWP/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.UWP/Properties/AssemblyInfo.cs
@@ -29,6 +29,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
[assembly: ComVisible(false)]
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Windows.Shared/Analytics.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Windows.Shared/Analytics.cs
index d6c8172e4..cbe7c23b2 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Windows.Shared/Analytics.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Windows.Shared/Analytics.cs
@@ -5,6 +5,7 @@
using Microsoft.Azure.Mobile.Analytics.Channel;
using Microsoft.Azure.Mobile.Ingestion.Models.Serialization;
using Microsoft.Azure.Mobile.Utils;
+using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile.Analytics
{
@@ -40,23 +41,27 @@ public static Analytics Instance
}
///
- /// Enable or disable Analytics module.
+ /// Check whether the Analytics service is enabled or not.
///
- public static bool Enabled
+ /// A task with result being true if enabled, false if disabled.
+ public static Task IsEnabledAsync()
{
- get
+ lock (AnalyticsLock)
{
- lock (AnalyticsLock)
- {
- return Instance.InstanceEnabled;
- }
+ return Task.FromResult(Instance.InstanceEnabled);
}
- set
+ }
+
+ ///
+ /// Enable or disable the Analytics service.
+ ///
+ /// A task to monitor the operation.
+ public static Task SetEnabledAsync(bool enabled)
+ {
+ lock (AnalyticsLock)
{
- lock (AnalyticsLock)
- {
- Instance.InstanceEnabled = value;
- }
+ Instance.InstanceEnabled = enabled;
+ return Task.FromResult(default(object));
}
}
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs
index b9e5ef48e..00300d9c0 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs
@@ -19,12 +19,12 @@ interface MSAnalytics
// +(void)trackEvent:(NSString *)eventName;
[Static]
[Export("trackEvent:")]
- void TrackEvent(string eventName);
+ void TrackEvent([NullAllowed] string eventName);
// +(void)trackEvent:(NSString *)eventName withProperties:(NSDictionary *)properties;
[Static]
[Export("trackEvent:withProperties:")]
- void TrackEvent(string eventName, NSDictionary properties);
+ void TrackEvent([NullAllowed] string eventName, [NullAllowed] NSDictionary properties);
// +(void)setDelegate:(id _Nullable)delegate;
[Static]
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/Properties/AssemblyInfo.cs
index 8f01cb13f..2b7f0b5b7 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/Properties/AssemblyInfo.cs
@@ -30,5 +30,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Analytics.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Analytics.cs
index 60ffa1c8f..e53070d29 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Analytics.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Analytics.cs
@@ -6,6 +6,7 @@
namespace Microsoft.Azure.Mobile.Analytics
{
using System.Linq;
+ using System.Threading.Tasks;
using iOSAnalytics = iOS.Bindings.MSAnalytics;
///
@@ -27,12 +28,22 @@ internal Analytics()
public static Type BindingType => typeof(iOSAnalytics);
///
- /// Enable or disable Analytics module.
+ /// Check whether the Analytics service is enabled or not.
///
- public static bool Enabled
+ /// A task with result being true if enabled, false if disabled.
+ public static Task IsEnabledAsync()
{
- get { return iOSAnalytics.IsEnabled(); }
- set { iOSAnalytics.SetEnabled(value); }
+ return Task.FromResult(iOSAnalytics.IsEnabled());
+ }
+
+ ///
+ /// Enable or disable the Analytics service.
+ ///
+ /// A task to monitor the operation.
+ public static Task SetEnabledAsync(bool enabled)
+ {
+ iOSAnalytics.SetEnabled(enabled);
+ return Task.FromResult(default(object));
}
///
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Properties/AssemblyInfo.cs
index 1ba7841ed..9d91fcde5 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Properties/AssemblyInfo.cs
@@ -23,5 +23,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Analytics.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Analytics.cs
index 24a2d69ec..22fcb0722 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Analytics.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Analytics.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile.Analytics
{
@@ -12,9 +13,22 @@ internal Analytics()
}
///
- /// Enable or disable Analytics module.
+ /// Check whether the Analytics service is enabled or not.
///
- public static bool Enabled { get; set; }
+ /// A task with result being true if enabled, false if disabled.
+ public static Task IsEnabledAsync()
+ {
+ return Task.FromResult(false);
+ }
+
+ ///
+ /// Enable or disable the Analytics service.
+ ///
+ /// A task to monitor the operation.
+ public static Task SetEnabledAsync(bool enabled)
+ {
+ return Task.FromResult(default(object));
+ }
/////
///// Enable or disable automatic page tracking.
diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Properties/AssemblyInfo.cs
index ceb48062e..e0d568ac1 100644
--- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Properties/AssemblyInfo.cs
@@ -25,5 +25,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android.Bindings/Properties/AssemblyInfo.cs
index 7e91f95d6..3ae96a228 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android.Bindings/Properties/AssemblyInfo.cs
@@ -17,8 +17,8 @@
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/ErrorReport.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/ErrorReport.cs
index 05a450cff..9de5d73d0 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/ErrorReport.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/ErrorReport.cs
@@ -13,7 +13,6 @@ internal ErrorReport(AndroidErrorReport androidReport)
AppStartTime = DateTimeOffset.FromUnixTimeMilliseconds(androidReport.AppStartTime.Time);
AppErrorTime = DateTimeOffset.FromUnixTimeMilliseconds(androidReport.AppErrorTime.Time);
Device = androidReport.Device == null ? null : new Device(androidReport.Device);
-
object androidThrowable;
try
{
@@ -23,15 +22,14 @@ internal ErrorReport(AndroidErrorReport androidReport)
{
MobileCenterLog.Debug(Crashes.LogTag, "Cannot read throwable from java point of view, probably a .NET exception", e);
androidThrowable = null;
- byte[] exceptionBytes = AndroidExceptionDataManager.LoadWrapperExceptionData(Java.Util.UUID.FromString(Id));
- if (exceptionBytes != null)
- {
- Exception = CrashesUtils.DeserializeException(exceptionBytes);
- }
}
-
AndroidDetails = new AndroidErrorDetails(androidThrowable, androidReport.ThreadName);
iOSDetails = null;
+ byte[] exceptionBytes = AndroidExceptionDataManager.LoadWrapperExceptionData(Java.Util.UUID.FromString(Id));
+ if (exceptionBytes != null)
+ {
+ Exception = CrashesUtils.DeserializeException(exceptionBytes);
+ }
}
}
}
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/PlatformCrashes.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/PlatformCrashes.cs
index f4f3ff1d4..2d452c13c 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/PlatformCrashes.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/PlatformCrashes.cs
@@ -4,17 +4,17 @@
using System.Linq;
using System.Threading.Tasks;
using Android.Runtime;
-using Com.Microsoft.Azure.Mobile;
using Com.Microsoft.Azure.Mobile.Crashes.Model;
+using Java.Lang;
namespace Microsoft.Azure.Mobile.Crashes
{
- using ModelException = Com.Microsoft.Azure.Mobile.Crashes.Ingestion.Models.Exception;
- using ModelStackFrame = Com.Microsoft.Azure.Mobile.Crashes.Ingestion.Models.StackFrame;
- using AndroidManagedErrorLog = Com.Microsoft.Azure.Mobile.Crashes.Ingestion.Models.ManagedErrorLog;
using AndroidCrashes = Com.Microsoft.Azure.Mobile.Crashes.AndroidCrashes;
- using AndroidICrashListener = Com.Microsoft.Azure.Mobile.Crashes.ICrashesListener;
using AndroidExceptionDataManager = Com.Microsoft.Azure.Mobile.Crashes.WrapperSdkExceptionManager;
+ using AndroidICrashListener = Com.Microsoft.Azure.Mobile.Crashes.ICrashesListener;
+ using ModelException = Com.Microsoft.Azure.Mobile.Crashes.Ingestion.Models.Exception;
+ using ModelStackFrame = Com.Microsoft.Azure.Mobile.Crashes.Ingestion.Models.StackFrame;
+ using Exception = System.Exception;
class PlatformCrashes : PlatformCrashesBase
{
@@ -50,40 +50,34 @@ public override void NotifyUserConfirmation(UserConfirmation confirmation)
public override Type BindingType => typeof(AndroidCrashes);
- public override bool Enabled
+ public override Task IsEnabledAsync()
{
- get { return AndroidCrashes.Enabled; }
- set { AndroidCrashes.Enabled = value; }
+ var future = AndroidCrashes.IsEnabled();
+ return Task.Run(() => (bool)future.Get());
}
- public override bool HasCrashedInLastSession => AndroidCrashes.HasCrashedInLastSession;
-
- public override async Task GetLastSessionCrashReportAsync()
+ public override Task SetEnabledAsync(bool enabled)
{
- var callback = new GetLastSessionCrashReportCallback();
- AndroidCrashes.GetLastSessionCrashReport(callback);
- var androidErrorReport = await callback.Result.ConfigureAwait(false);
- if (androidErrorReport == null)
- return null;
- return ErrorReportCache.GetErrorReport(androidErrorReport);
+ var future = AndroidCrashes.SetEnabled(enabled);
+ return Task.Run(() => future.Get());
}
- class GetLastSessionCrashReportCallback : Java.Lang.Object, IResultCallback
+ public override Task HasCrashedInLastSessionAsync()
{
- AndroidErrorReport _result;
-
- internal Task Result { get; }
-
- internal GetLastSessionCrashReportCallback()
- {
- Result = new Task(() => _result);
- }
+ var future = AndroidCrashes.HasCrashedInLastSession();
+ return Task.Run(() => (bool)future.Get());
+ }
- public void OnResult(Java.Lang.Object result)
+ public override Task GetLastSessionCrashReportAsync()
+ {
+ var future = AndroidCrashes.LastSessionCrashReport;
+ return Task.Run(() =>
{
- _result = result as AndroidErrorReport;
- Result.Start();
- }
+ var androidErrorReport = future.Get() as AndroidErrorReport;
+ if (androidErrorReport == null)
+ return null;
+ return ErrorReportCache.GetErrorReport(androidErrorReport);
+ });
}
//public override void TrackException(Exception exception)
@@ -98,21 +92,10 @@ public void OnResult(Java.Lang.Object result)
///
private static readonly ModelStackFrame EmptyModelFrame = new ModelStackFrame();
- ///
- /// Error log generated by the Android SDK on a crash.
- ///
- private static AndroidManagedErrorLog _errorLog;
-
- ///
- /// C# unhandled exception caught by this class.
- ///
- private static Exception _exception;
-
static PlatformCrashes()
{
MobileCenterLog.Info(Crashes.LogTag, "Set up Xamarin crash handler.");
AndroidEnvironment.UnhandledExceptionRaiser += OnUnhandledException;
- AndroidCrashes.Instance.SetWrapperSdkListener(new CrashListener());
}
public PlatformCrashes()
@@ -123,40 +106,13 @@ public PlatformCrashes()
private static void OnUnhandledException(object sender, RaiseThrowableEventArgs e)
{
- _exception = e.Exception;
- MobileCenterLog.Error(Crashes.LogTag, "Unhandled Exception:", _exception);
- JoinExceptionAndLog();
- }
-
- ///
- /// We don't assume order between java crash handler and c# crash handler.
- /// This method is called after either of those 2 events and is thus effective only the second time when we got both the c# exception and the Android error log.
- ///
- private static void JoinExceptionAndLog()
- {
- /*
- * We don't assume order between java crash handler and c# crash handler.
- * This method is called after either of those 2 events.
- * It is thus effective only the second time when we got both the .NET exception and the Android error log.
- */
- if (_errorLog != null && _exception != null)
+ var exception = e.Exception;
+ MobileCenterLog.Error(Crashes.LogTag, "Unhandled Exception:", exception);
+ if (!(exception is Java.Lang.Exception))
{
- /*
- * Generate structured data for the C# exception and overwrite the Java exception to enhance it.
- * Unless if we have java exception in top cause, this would make it worse.
- * Having java exception as intermediate cause is better with .NET stack structure though.
- */
- if (!(_exception is Java.Lang.Exception))
- {
- _errorLog.Exception = GenerateModelException(_exception);
-
- /* Tell the Android SDK to overwrite the modified error log on disk. */
- AndroidExceptionDataManager.SaveWrapperSdkErrorLog(_errorLog);
- }
-
- /* Save the System.Exception to disk as a serialized object for client side inspection. */
- byte[] exceptionData = CrashesUtils.SerializeException(_exception);
- AndroidExceptionDataManager.SaveWrapperExceptionData(exceptionData, _errorLog.Id);
+ var modelException = GenerateModelException(exception);
+ byte[] rawException = CrashesUtils.SerializeException(exception);
+ AndroidExceptionDataManager.SaveWrapperException(Thread.CurrentThread(), modelException, rawException);
}
}
@@ -209,15 +165,6 @@ private static IList GenerateModelStackFrames(StackTrace stackT
}
return modelFrames;
}
-
- class CrashListener : Java.Lang.Object, AndroidCrashes.IWrapperSdkListener
- {
- public void OnCrashCaptured(AndroidManagedErrorLog errorLog)
- {
- _errorLog = errorLog;
- JoinExceptionAndLog();
- }
- }
#pragma warning restore XS0001 // Find usages of mono todo items
}
}
\ No newline at end of file
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/Properties/AssemblyInfo.cs
index 735388391..8672d5977 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/Properties/AssemblyInfo.cs
@@ -26,5 +26,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/Crashes.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/Crashes.cs
index 9e10be1c8..e18c5ee4d 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/Crashes.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/Crashes.cs
@@ -22,7 +22,7 @@ static Crashes()
SentErrorReport?.Invoke(sender, e);
};
- PlatformCrashes.FailedToSendErrorReport += (sender, e) =>
+ PlatformCrashes.FailedToSendErrorReport += (sender, e) =>
{
FailedToSendErrorReport?.Invoke(sender, e);
};
@@ -155,22 +155,34 @@ public static void NotifyUserConfirmation(UserConfirmation confirmation)
public static Type BindingType => PlatformCrashes.BindingType;
#if WINDOWS_UWP
-
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This does not exist in UWP and should not be used.")]
#else
///
- /// Enables or disables Crashes module.
+ /// Check whether the Crashes service is enabled or not.
///
+ /// A task with result being true if enabled, false if disabled.
#endif
- public static bool Enabled
+ public static Task IsEnabledAsync()
{
- get { return PlatformCrashes.Enabled; }
- set { PlatformCrashes.Enabled = value; }
+ return PlatformCrashes.IsEnabledAsync();
}
#if WINDOWS_UWP
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ [Obsolete("This does not exist in UWP and should not be used.")]
+#else
+ ///
+ /// Enable or disable the Crashes service.
+ ///
+ /// A task to monitor the operation.
+#endif
+ public static Task SetEnabledAsync(bool enabled)
+ {
+ return PlatformCrashes.SetEnabledAsync(enabled);
+ }
+#if WINDOWS_UWP
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This does not exist in UWP and should not be used.")]
#else
@@ -178,10 +190,10 @@ public static bool Enabled
/// Provides information whether the app crashed in its last session.
///
///
- /// true if a crash was recorded in the last session, otherwise false.
+ /// Task with result being true if a crash was recorded in the last session, otherwise false.
///
#endif
- public static bool HasCrashedInLastSession => PlatformCrashes.HasCrashedInLastSession;
+ public static Task HasCrashedInLastSessionAsync() => PlatformCrashes.HasCrashedInLastSessionAsync();
#if WINDOWS_UWP
[EditorBrowsable(EditorBrowsableState.Never)]
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/IPlatformCrashes.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/IPlatformCrashes.cs
index 015e3f8c9..2f297d9b6 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/IPlatformCrashes.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/IPlatformCrashes.cs
@@ -6,13 +6,15 @@ namespace Microsoft.Azure.Mobile.Crashes
///
/// Interface to abstract features between different platforms.
///
- internal interface IPlatformCrashes
+ interface IPlatformCrashes
{
Type BindingType { get; }
- bool Enabled { get; set; }
+ Task IsEnabledAsync();
- bool HasCrashedInLastSession { get; }
+ Task SetEnabledAsync(bool enabled);
+
+ Task HasCrashedInLastSessionAsync();
Task GetLastSessionCrashReportAsync();
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/PlatformCrashesBase.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/PlatformCrashesBase.cs
index 46a60c811..77260dbf1 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/PlatformCrashesBase.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Shared/PlatformCrashesBase.cs
@@ -10,9 +10,11 @@ abstract class PlatformCrashesBase : IPlatformCrashes
{
public abstract Type BindingType { get; }
- public abstract bool Enabled { get; set; }
+ public abstract Task IsEnabledAsync();
- public abstract bool HasCrashedInLastSession { get; }
+ public abstract Task SetEnabledAsync(bool enabled);
+
+ public abstract Task HasCrashedInLastSessionAsync();
public abstract Task GetLastSessionCrashReportAsync();
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.UWP/PlatformCrashes.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.UWP/PlatformCrashes.cs
index b67fb63b6..e6944814a 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.UWP/PlatformCrashes.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.UWP/PlatformCrashes.cs
@@ -19,9 +19,20 @@ internal class PlatformCrashes : PlatformCrashesBase
public override Type BindingType { get; }
- public override bool Enabled { get; set; }
+ public override Task IsEnabledAsync()
+ {
+ return Task.FromResult(false);
+ }
- public override bool HasCrashedInLastSession { get; }
+ public override Task SetEnabledAsync(bool enabled)
+ {
+ return Task.FromResult(default(object));
+ }
+
+ public override Task HasCrashedInLastSessionAsync()
+ {
+ return Task.FromResult(false);
+ }
public override GetErrorAttachmentsCallback GetErrorAttachments { get; set; }
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.UWP/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.UWP/Properties/AssemblyInfo.cs
index fa6af4fb2..ef5ad84b0 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.UWP/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.UWP/Properties/AssemblyInfo.cs
@@ -29,6 +29,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS.Bindings/ApiDefinition.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS.Bindings/ApiDefinition.cs
index 387d972d9..4e8d2a72f 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS.Bindings/ApiDefinition.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS.Bindings/ApiDefinition.cs
@@ -97,6 +97,11 @@ interface MSCrashes
[Static]
[Export("notifyWithUserConfirmation:")]
void NotifyWithUserConfirmation(MSUserConfirmation userConfirmation);
+
+ //+(void)disableMachExceptionHandler;
+ [Static]
+ [Export("disableMachExceptionHandler")]
+ void DisableMachExceptionHandler();
}
// @protocol MSCrashesDelegate
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS.Bindings/Properties/AssemblyInfo.cs
index 550ad5fcb..22582436f 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS.Bindings/Properties/AssemblyInfo.cs
@@ -30,5 +30,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/PlatformCrashes.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/PlatformCrashes.cs
index 43dba79d5..e9aa52f1e 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/PlatformCrashes.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/PlatformCrashes.cs
@@ -22,13 +22,21 @@ class PlatformCrashes : PlatformCrashesBase
public override Type BindingType => typeof(MSCrashes);
- public override bool Enabled
+ public override Task IsEnabledAsync()
{
- get { return MSCrashes.IsEnabled(); }
- set { MSCrashes.SetEnabled(value); }
+ return Task.FromResult(MSCrashes.IsEnabled());
}
- public override bool HasCrashedInLastSession => MSCrashes.HasCrashedInLastSession;
+ public override Task SetEnabledAsync(bool enabled)
+ {
+ MSCrashes.SetEnabled(enabled);
+ return Task.FromResult(default(object));
+ }
+
+ public override Task HasCrashedInLastSessionAsync()
+ {
+ return Task.FromResult(MSCrashes.HasCrashedInLastSession);
+ }
public override Task GetLastSessionCrashReportAsync()
{
@@ -71,6 +79,7 @@ public override void NotifyUserConfirmation(UserConfirmation confirmation)
static PlatformCrashes()
{
/* Peform custom setup around the native SDK's for setting signal handlers */
+ MSCrashes.DisableMachExceptionHandler();
MSWrapperExceptionManager.SetDelegate(new CrashesInitializationDelegate());
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
}
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/Properties/AssemblyInfo.cs
index 9d09c1398..e29280239 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/Properties/AssemblyInfo.cs
@@ -23,5 +23,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/PlatformCrashes.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/PlatformCrashes.cs
index e2b591f5d..9943c08cf 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/PlatformCrashes.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/PlatformCrashes.cs
@@ -20,9 +20,20 @@ internal class PlatformCrashes : PlatformCrashesBase
public override Type BindingType { get; }
- public override bool Enabled { get; set; }
+ public override Task IsEnabledAsync()
+ {
+ return Task.FromResult(false);
+ }
- public override bool HasCrashedInLastSession { get; }
+ public override Task SetEnabledAsync(bool enabled)
+ {
+ return Task.FromResult(default(object));
+ }
+
+ public override Task HasCrashedInLastSessionAsync()
+ {
+ return Task.FromResult(false);
+ }
public override Task GetLastSessionCrashReportAsync()
{
diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs
index bc86582ae..1a461c8ee 100644
--- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs
@@ -25,5 +25,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android.Bindings/Properties/AssemblyInfo.cs
index 5a5c0c77b..13b5ccd83 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android.Bindings/Properties/AssemblyInfo.cs
@@ -17,8 +17,8 @@
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android/Distribute.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android/Distribute.cs
index b1c643ff3..6263c5ddc 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android/Distribute.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android/Distribute.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading.Tasks;
using Android.App;
using Android.Runtime;
using Com.Microsoft.Azure.Mobile.Distribute;
@@ -10,17 +11,16 @@ public static partial class Distribute
[Preserve]
public static Type BindingType => typeof(AndroidDistribute);
- static bool PlatformEnabled
+ static Task PlatformIsEnabledAsync()
{
- get
- {
- return AndroidDistribute.Enabled;
- }
+ var future = AndroidDistribute.IsEnabled();
+ return Task.Run(() => (bool)future.Get());
+ }
- set
- {
- AndroidDistribute.Enabled = value;
- }
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ var future = AndroidDistribute.SetEnabled(enabled);
+ return Task.Run(() => future.Get());
}
static void PlatformSetInstallUrl(string installUrl)
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android/Properties/AssemblyInfo.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android/Properties/AssemblyInfo.cs
index 1aeddc986..14c019685 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Android/Properties/AssemblyInfo.cs
@@ -25,5 +25,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Shared/Distribute.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Shared/Distribute.cs
index 90071577c..6339431c4 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Shared/Distribute.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.Shared/Distribute.cs
@@ -1,4 +1,4 @@
-using System;
+using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile.Distribute
{
@@ -8,19 +8,21 @@ namespace Microsoft.Azure.Mobile.Distribute
public static partial class Distribute
{
///
- /// Enable or disable Distribute module.
+ /// Check whether the Distribute service is enabled or not.
///
- public static bool Enabled
+ /// A task with result being true if enabled, false if disabled.
+ public static Task IsEnabledAsync()
{
- get
- {
- return PlatformEnabled;
- }
+ return PlatformIsEnabledAsync();
+ }
- set
- {
- PlatformEnabled = value;
- }
+ ///
+ /// Enable or disable the Distribute service.
+ ///
+ /// A task to monitor the operation.
+ public static Task SetEnabledAsync(bool enabled)
+ {
+ return PlatformSetEnabledAsync(enabled);
}
///
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS.Bindings/Properties/AssemblyInfo.cs
index b22962593..367e56d66 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS.Bindings/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS/Distribute.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS/Distribute.cs
index 01bc01c60..984aca939 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS/Distribute.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS/Distribute.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading.Tasks;
using Foundation;
using Microsoft.Azure.Mobile.Distribute.iOS.Bindings;
@@ -17,17 +18,15 @@ public static Type BindingType
}
}
- static bool PlatformEnabled
+ static Task PlatformIsEnabledAsync()
{
- get
- {
- return MSDistribute.IsEnabled();
- }
+ return Task.FromResult(MSDistribute.IsEnabled());
+ }
- set
- {
- MSDistribute.SetEnabled(value);
- }
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ MSDistribute.SetEnabled(enabled);
+ return Task.FromResult(default(object));
}
static void PlatformSetInstallUrl(string installUrl)
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS/Properties/AssemblyInfo.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS/Properties/AssemblyInfo.cs
index e40ede25e..22a247808 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute.iOS/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute/Distribute.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute/Distribute.cs
index baaf8d153..d5fff0909 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute/Distribute.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute/Distribute.cs
@@ -1,8 +1,18 @@
-namespace Microsoft.Azure.Mobile.Distribute
+using System.Threading.Tasks;
+
+namespace Microsoft.Azure.Mobile.Distribute
{
public static partial class Distribute
{
- static bool PlatformEnabled { get; set; }
+ static Task PlatformIsEnabledAsync()
+ {
+ return Task.FromResult(false);
+ }
+
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ return Task.FromResult(default(object));
+ }
static void PlatformSetInstallUrl(string installUrl)
{
diff --git a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute/Properties/AssemblyInfo.cs b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute/Properties/AssemblyInfo.cs
index e8dbfe429..590d0b725 100644
--- a/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterDistribute/Microsoft.Azure.Mobile.Distribute/Properties/AssemblyInfo.cs
@@ -25,5 +25,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android.Bindings/Properties/AssemblyInfo.cs
index 349096edd..3046e587b 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android.Bindings/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android/Properties/AssemblyInfo.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android/Properties/AssemblyInfo.cs
index 19ff409f7..e63d29d54 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android/Push.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android/Push.cs
index 2c4e4155e..6c6d7d986 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android/Push.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Android/Push.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading.Tasks;
using Android.App;
using Android.Content;
using Android.Runtime;
@@ -25,10 +26,16 @@ static Push()
AndroidPush.SetListener(_pushListener);
}
- static bool PlatformEnabled
+ static Task PlatformIsEnabledAsync()
{
- get { return AndroidPush.Enabled; }
- set { AndroidPush.Enabled = value; }
+ var future = AndroidPush.IsEnabled();
+ return Task.Run(() => (bool)future.Get());
+ }
+
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ var future = AndroidPush.SetEnabled(enabled);
+ return Task.Run(() => future.Get());
}
///
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Shared/Push.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Shared/Push.cs
index 7f64f8d4c..596d95ab1 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Shared/Push.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Shared/Push.cs
@@ -1,4 +1,5 @@
using System;
+using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile.Push
{
@@ -8,12 +9,21 @@ namespace Microsoft.Azure.Mobile.Push
public partial class Push
{
///
- /// Enable or disable Push module.
+ /// Check whether the Push service is enabled or not.
///
- public static bool Enabled
+ /// A task with result being true if enabled, false if disabled.
+ public static Task IsEnabledAsync()
{
- get { return PlatformEnabled; }
- set { PlatformEnabled = value; }
+ return PlatformIsEnabledAsync();
+ }
+
+ ///
+ /// Enable or disable the Push service.
+ ///
+ /// A task to monitor the operation.
+ public static Task SetEnabledAsync(bool enabled)
+ {
+ return PlatformSetEnabledAsync(enabled);
}
///
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.UWP/Properties/AssemblyInfo.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.UWP/Properties/AssemblyInfo.cs
index 878708348..c2596691f 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.UWP/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.UWP/Properties/AssemblyInfo.cs
@@ -28,6 +28,6 @@
[assembly: ReferenceAssembly]
#endif
[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("Microsoft.Azure.Mobile.Test.UWP")]
\ No newline at end of file
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.UWP/Push.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.UWP/Push.cs
index 33c262844..046a97cc5 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.UWP/Push.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.UWP/Push.cs
@@ -42,7 +42,7 @@ private void InstanceCheckLaunchedFromNotification(LaunchActivatedEventArgs e)
}
if (customData != null)
{
- PushNotificationReceived?.Invoke(null, new PushNotificationReceivedEventArgs()
+ PushNotificationReceived?.Invoke(null, new PushNotificationReceivedEventArgs
{
Title = null,
Message = null,
@@ -81,8 +81,13 @@ private void ApplyEnabledState(bool enabled)
// Send channel URI to backend
MobileCenterLog.Debug(LogTag, $"Push token '{pushToken}'");
+
var pushInstallationLog = new PushInstallationLog(null, null, pushToken, Guid.NewGuid());
- await Channel.EnqueueAsync(pushInstallationLog).ConfigureAwait(false);
+
+ // Do not await the call to EnqueueAsync or the UI thread can be blocked!
+#pragma warning disable CS4014
+ Channel.EnqueueAsync(pushInstallationLog);
+#pragma warning restore
}
else
{
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Windows.Shared/Push.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Windows.Shared/Push.cs
index 5ccdd628b..f748ee740 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Windows.Shared/Push.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.Windows.Shared/Push.cs
@@ -2,6 +2,7 @@
using Microsoft.Azure.Mobile.Ingestion.Models.Serialization;
using Microsoft.Azure.Mobile.Push.Ingestion.Models;
using Microsoft.Azure.Mobile.Utils.Synchronization;
+using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile.Push
{
@@ -30,24 +31,20 @@ public static Push Instance
}
}
- ///
- /// Push module enabled or disabled
- ///
- private static bool PlatformEnabled
+ static Task PlatformIsEnabledAsync()
{
- get
+ lock (PushLock)
{
- lock (PushLock)
- {
- return Instance.InstanceEnabled;
- }
+ return Task.FromResult(Instance.InstanceEnabled);
}
- set
+ }
+
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ lock (PushLock)
{
- lock (PushLock)
- {
- Instance.InstanceEnabled = value;
- }
+ Instance.InstanceEnabled = enabled;
+ return Task.FromResult(default(object));
}
}
@@ -76,7 +73,7 @@ public override void OnChannelGroupReady(IChannelGroup channelGroup, string appS
using (_mutex.GetLock())
{
base.OnChannelGroupReady(channelGroup, appSecret);
- ApplyEnabledState(Enabled);
+ ApplyEnabledState(IsEnabledAsync().Result);
}
}
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS.Bindings/Properties/AssemblyInfo.cs
index 6fe731d88..2612b5a96 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS.Bindings/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS.Bindings/Properties/AssemblyInfo.cs
@@ -30,5 +30,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS/Properties/AssemblyInfo.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS/Properties/AssemblyInfo.cs
index 3bd07f5b9..f84407b9f 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS/Push.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS/Push.cs
index 9243464b9..e68a19a4e 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS/Push.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push.iOS/Push.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Threading.Tasks;
using Foundation;
using Microsoft.Azure.Mobile.Push.iOS;
using Microsoft.Azure.Mobile.Push.iOS.Bindings;
@@ -26,16 +27,21 @@ static Push()
MSPush.SetDelegate(_pushDelegate);
}
- private static bool PlatformEnabled
+ static Task PlatformIsEnabledAsync()
{
- get { return MSPush.IsEnabled(); }
- set { MSPush.SetEnabled(value); }
+ return Task.FromResult(MSPush.IsEnabled());
+ }
+
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ MSPush.SetEnabled(enabled);
+ return Task.FromResult(default(object));
}
[Preserve]
public static Type BindingType
{
- get
+ get
{
return _internalBindingType;
}
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push/Properties/AssemblyInfo.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push/Properties/AssemblyInfo.cs
index 4724e1726..c1260e32b 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push/Properties/AssemblyInfo.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push/Properties/AssemblyInfo.cs
@@ -24,5 +24,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push/Push.cs b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push/Push.cs
index 5ac524538..468aceec9 100644
--- a/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push/Push.cs
+++ b/SDK/MobileCenterPush/Microsoft.Azure.Mobile.Push/Push.cs
@@ -1,7 +1,17 @@
-namespace Microsoft.Azure.Mobile.Push
+using System.Threading.Tasks;
+
+namespace Microsoft.Azure.Mobile.Push
{
- public partial class Push
- {
- static bool PlatformEnabled { get; set; }
+ public partial class Push
+ {
+ static Task PlatformIsEnabledAsync()
+ {
+ return Task.FromResult(false);
+ }
+
+ static Task PlatformSetEnabledAsync(bool enabled)
+ {
+ return Task.FromResult(default(object));
+ }
}
}
diff --git a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj
index 8724e3248..1617e10fc 100644
--- a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj
+++ b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj
@@ -104,13 +104,13 @@
..\..\packages\Xamarin.Forms.2.3.4.231\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll
- ..\..\packages\Microsoft.Azure.Mobile.0.8.2-r0001-f692127\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.dll
-
-
- ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.8.2-r0001-f692127\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll
+ ..\..\packages\Microsoft.Azure.Mobile.0.13.1-r0012-bc49197\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.dll
- ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.8.2-r0001-f692127\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll
+ ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.13.1-r0012-bc49197\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll
+
+
+ ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.13.1-r0012-bc49197\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll
diff --git a/Tests/Contoso.Forms.Test/Module Pages/CorePage.xaml.cs b/Tests/Contoso.Forms.Test/Module Pages/CorePage.xaml.cs
index ba65fcbdf..b2fff0780 100644
--- a/Tests/Contoso.Forms.Test/Module Pages/CorePage.xaml.cs
+++ b/Tests/Contoso.Forms.Test/Module Pages/CorePage.xaml.cs
@@ -16,7 +16,7 @@ protected override void OnAppearing()
base.OnAppearing();
if (InstallIdLabel != null)
{
- InstallIdLabel.Text = MobileCenter.InstallId?.ToString();
+ InstallIdLabel.Text = MobileCenter.GetInstallIdAsync().Result?.ToString();
}
}
diff --git a/Tests/Contoso.Forms.Test/Module Pages/CrashResults Pages/CrashResultsPage.xaml.cs b/Tests/Contoso.Forms.Test/Module Pages/CrashResults Pages/CrashResultsPage.xaml.cs
index 90395bac8..2f4fceb52 100644
--- a/Tests/Contoso.Forms.Test/Module Pages/CrashResults Pages/CrashResultsPage.xaml.cs
+++ b/Tests/Contoso.Forms.Test/Module Pages/CrashResults Pages/CrashResultsPage.xaml.cs
@@ -21,7 +21,7 @@ protected override void OnAppearing()
if (HasCrashedInLastSessionLabel != null)
{
- if (Crashes.HasCrashedInLastSession)
+ if (Crashes.HasCrashedInLastSessionAsync().Result)
{
HasCrashedInLastSessionLabel.Text = TestStrings.HasCrashedInLastSessionText;
}
@@ -115,7 +115,7 @@ public void InitializeText()
{
if (HasCrashedInLastSessionLabel != null)
{
- if (Crashes.HasCrashedInLastSession)
+ if (Crashes.HasCrashedInLastSessionAsync().Result)
{
HasCrashedInLastSessionLabel.Text = TestStrings.HasCrashedInLastSessionText;
}
diff --git a/Tests/Contoso.Forms.Test/Module Pages/ToggleStatesPage.xaml.cs b/Tests/Contoso.Forms.Test/Module Pages/ToggleStatesPage.xaml.cs
index e198077d9..26474ec10 100644
--- a/Tests/Contoso.Forms.Test/Module Pages/ToggleStatesPage.xaml.cs
+++ b/Tests/Contoso.Forms.Test/Module Pages/ToggleStatesPage.xaml.cs
@@ -16,37 +16,37 @@ public ToggleStatesPage()
void EnableMobileCenter(object sender, System.EventArgs e)
{
- MobileCenter.Enabled = true;
+ MobileCenter.SetEnabledAsync(true).Wait();
UpdateEnabledStateLabels();
}
void EnableCrashes(object sender, System.EventArgs e)
{
- Crashes.Enabled = true;
+ Crashes.SetEnabledAsync(true).Wait();
UpdateEnabledStateLabels();
}
void EnableAnalytics(object sender, System.EventArgs e)
{
- Analytics.Enabled = true;
+ Analytics.SetEnabledAsync(true).Wait();
UpdateEnabledStateLabels();
}
void DisableMobileCenter(object sender, System.EventArgs e)
{
- MobileCenter.Enabled = false;
+ MobileCenter.SetEnabledAsync(false).Wait();
UpdateEnabledStateLabels();
}
void DisableCrashes(object sender, System.EventArgs e)
{
- Crashes.Enabled = false;
+ Crashes.SetEnabledAsync(false).Wait();
UpdateEnabledStateLabels();
}
void DisableAnalytics(object sender, System.EventArgs e)
{
- Analytics.Enabled = false;
+ Analytics.SetEnabledAsync(false).Wait();
UpdateEnabledStateLabels();
}
@@ -63,7 +63,7 @@ void UpdateCrashesLabel()
{
if (CrashesEnabledLabel != null)
{
- CrashesEnabledLabel.Text = Crashes.Enabled ? TestStrings.CrashesEnabledText : TestStrings.CrashesDisabledText;
+ CrashesEnabledLabel.Text = Crashes.IsEnabledAsync().Result ? TestStrings.CrashesEnabledText : TestStrings.CrashesDisabledText;
}
}
@@ -71,7 +71,7 @@ void UpdateAnalyticsLabel()
{
if (AnalyticsEnabledLabel != null)
{
- AnalyticsEnabledLabel.Text = Analytics.Enabled ? TestStrings.AnalyticsEnabledText : TestStrings.AnalyticsDisabledText;
+ AnalyticsEnabledLabel.Text = Analytics.IsEnabledAsync().Result ? TestStrings.AnalyticsEnabledText : TestStrings.AnalyticsDisabledText;
}
}
@@ -79,7 +79,7 @@ void UpdateMobileCenterLabel()
{
if (MobileCenterEnabledLabel != null)
{
- MobileCenterEnabledLabel.Text = MobileCenter.Enabled ? TestStrings.MobileCenterEnabledText : TestStrings.MobileCenterDisabledText;
+ MobileCenterEnabledLabel.Text = MobileCenter.IsEnabledAsync().Result ? TestStrings.MobileCenterEnabledText : TestStrings.MobileCenterDisabledText;
}
}
diff --git a/Tests/Contoso.Forms.Test/Properties/AssemblyInfo.cs b/Tests/Contoso.Forms.Test/Properties/AssemblyInfo.cs
index 2a35e97c6..23a29454e 100644
--- a/Tests/Contoso.Forms.Test/Properties/AssemblyInfo.cs
+++ b/Tests/Contoso.Forms.Test/Properties/AssemblyInfo.cs
@@ -17,8 +17,8 @@
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/Tests/Contoso.Forms.Test/packages.config b/Tests/Contoso.Forms.Test/packages.config
index 5f81e90fd..5cdc3f2d5 100644
--- a/Tests/Contoso.Forms.Test/packages.config
+++ b/Tests/Contoso.Forms.Test/packages.config
@@ -1,7 +1,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/Tests/Droid/Contoso.Forms.Test.Droid.csproj b/Tests/Droid/Contoso.Forms.Test.Droid.csproj
index 8ac87440e..741498dc3 100644
--- a/Tests/Droid/Contoso.Forms.Test.Droid.csproj
+++ b/Tests/Droid/Contoso.Forms.Test.Droid.csproj
@@ -109,22 +109,22 @@
..\..\packages\Xamarin.Forms.2.3.4.231\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
- ..\..\packages\Microsoft.Azure.Mobile.0.8.2-r0001-f692127\lib\MonoAndroid403\Microsoft.Azure.Mobile.Android.Bindings.dll
+ ..\..\packages\Microsoft.Azure.Mobile.0.13.1-r0012-bc49197\lib\MonoAndroid403\Microsoft.Azure.Mobile.Android.Bindings.dll
- ..\..\packages\Microsoft.Azure.Mobile.0.8.2-r0001-f692127\lib\MonoAndroid403\Microsoft.Azure.Mobile.dll
+ ..\..\packages\Microsoft.Azure.Mobile.0.13.1-r0012-bc49197\lib\MonoAndroid403\Microsoft.Azure.Mobile.dll
-
- ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.8.2-r0001-f692127\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll
-
-
- ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.8.2-r0001-f692127\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.dll
+
+ ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.13.1-r0012-bc49197\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll
- ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.8.2-r0001-f692127\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.dll
+ ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.13.1-r0012-bc49197\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.dll
-
- ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.8.2-r0001-f692127\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll
+
+ ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.13.1-r0012-bc49197\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll
+
+
+ ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.13.1-r0012-bc49197\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.dll
diff --git a/Tests/Droid/Properties/AndroidManifest.xml b/Tests/Droid/Properties/AndroidManifest.xml
index d3d3a502c..38bf2bfcf 100644
--- a/Tests/Droid/Properties/AndroidManifest.xml
+++ b/Tests/Droid/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/Tests/Droid/Properties/AssemblyInfo.cs b/Tests/Droid/Properties/AssemblyInfo.cs
index e2eca1c64..40af6228c 100644
--- a/Tests/Droid/Properties/AssemblyInfo.cs
+++ b/Tests/Droid/Properties/AssemblyInfo.cs
@@ -17,8 +17,8 @@
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
diff --git a/Tests/Droid/packages.config b/Tests/Droid/packages.config
index 4d829acd6..8e4893e18 100644
--- a/Tests/Droid/packages.config
+++ b/Tests/Droid/packages.config
@@ -1,8 +1,8 @@
-
-
-
+
+
+
diff --git a/Tests/Microsoft.Azure.Mobile.Analytics.NET/Properties/AssemblyInfo.cs b/Tests/Microsoft.Azure.Mobile.Analytics.NET/Properties/AssemblyInfo.cs
index 07bb151ee..e562d7596 100644
--- a/Tests/Microsoft.Azure.Mobile.Analytics.NET/Properties/AssemblyInfo.cs
+++ b/Tests/Microsoft.Azure.Mobile.Analytics.NET/Properties/AssemblyInfo.cs
@@ -33,7 +33,7 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
[assembly: InternalsVisibleTo("Microsoft.Azure.Mobile.Analytics.Test.Windows")]
\ No newline at end of file
diff --git a/Tests/Microsoft.Azure.Mobile.Analytics.Test.Windows/AnalyticsTest.cs b/Tests/Microsoft.Azure.Mobile.Analytics.Test.Windows/AnalyticsTest.cs
index 307d89a1f..e2e08c770 100644
--- a/Tests/Microsoft.Azure.Mobile.Analytics.Test.Windows/AnalyticsTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Analytics.Test.Windows/AnalyticsTest.cs
@@ -49,10 +49,10 @@ public void InstanceIsNotNull()
[TestMethod]
public void GetEnabled()
{
- Analytics.Enabled = false;
- var valWhenFalse = Analytics.Enabled;
- Analytics.Enabled = true;
- var valWhenTrue = Analytics.Enabled;
+ Analytics.SetEnabledAsync(false).Wait();
+ var valWhenFalse = Analytics.IsEnabledAsync().Result;
+ Analytics.SetEnabledAsync(true).Wait();
+ var valWhenTrue = Analytics.IsEnabledAsync().Result;
Assert.IsFalse(valWhenFalse);
Assert.IsTrue(valWhenTrue);
@@ -120,7 +120,7 @@ public void StartAnalyticsAfterStartWasInvokedAndNotSuspended()
[TestMethod]
public void SetEnabledFalse()
{
- Analytics.Enabled = false;
+ Analytics.SetEnabledAsync(false).Wait();
Analytics.Instance.OnChannelGroupReady(_mockChannelGroup.Object, string.Empty);
_applicationLifecycleHelper.InvokeStarted();
_applicationLifecycleHelper.InvokeSuspended();
@@ -136,9 +136,9 @@ public void SetEnabledFalse()
[TestMethod]
public void EnableAfterDisabling()
{
- Analytics.Enabled = false;
+ Analytics.SetEnabledAsync(false).Wait();
Analytics.Instance.OnChannelGroupReady(_mockChannelGroup.Object, string.Empty);
- Analytics.Enabled = true;
+ Analytics.SetEnabledAsync(true).Wait();
_applicationLifecycleHelper.InvokeStarted();
_applicationLifecycleHelper.InvokeSuspended();
@@ -154,7 +154,7 @@ public void EnableAfterDisabling()
[TestMethod]
public void TrackEvent()
{
- Analytics.Enabled = true;
+ Analytics.SetEnabledAsync(true).Wait();
Analytics.Instance.OnChannelGroupReady(_mockChannelGroup.Object, string.Empty);
var eventName = "eventName";
var key = "key";
@@ -175,7 +175,7 @@ public void TrackEvent()
[TestMethod]
public void TrackEventInvalid()
{
- Analytics.Enabled = true;
+ Analytics.SetEnabledAsync(true).Wait();
Analytics.Instance.OnChannelGroupReady(_mockChannelGroup.Object, string.Empty);
// Event name is null or empty
@@ -234,7 +234,7 @@ public void TrackEventInvalid()
public void TrackEventWhileDisabled()
{
Analytics.Instance.OnChannelGroupReady(_mockChannelGroup.Object, string.Empty);
- Analytics.Enabled = false;
+ Analytics.SetEnabledAsync(false).Wait();
Analytics.TrackEvent("anevent");
_mockChannel.Verify(channel => channel.EnqueueAsync(It.IsAny()), Times.Never());
diff --git a/Tests/Microsoft.Azure.Mobile.Analytics.Test.Windows/Properties/AssemblyInfo.cs b/Tests/Microsoft.Azure.Mobile.Analytics.Test.Windows/Properties/AssemblyInfo.cs
index ddc043c5e..b5d1d38d6 100644
--- a/Tests/Microsoft.Azure.Mobile.Analytics.Test.Windows/Properties/AssemblyInfo.cs
+++ b/Tests/Microsoft.Azure.Mobile.Analytics.Test.Windows/Properties/AssemblyInfo.cs
@@ -16,5 +16,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/Tests/Microsoft.Azure.Mobile.NET/Properties/AssemblyInfo.cs b/Tests/Microsoft.Azure.Mobile.NET/Properties/AssemblyInfo.cs
index 8cc480093..e5322b301 100644
--- a/Tests/Microsoft.Azure.Mobile.NET/Properties/AssemblyInfo.cs
+++ b/Tests/Microsoft.Azure.Mobile.NET/Properties/AssemblyInfo.cs
@@ -33,8 +33,8 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
[assembly: InternalsVisibleTo("Microsoft.Azure.Mobile.Test.Windows")]
[assembly: InternalsVisibleTo("Microsoft.Azure.Mobile.Analytics.Test.Windows")]
diff --git a/Tests/Microsoft.Azure.Mobile.Push.NET/Properties/AssemblyInfo.cs b/Tests/Microsoft.Azure.Mobile.Push.NET/Properties/AssemblyInfo.cs
index 245d12237..fe6d68bc6 100644
--- a/Tests/Microsoft.Azure.Mobile.Push.NET/Properties/AssemblyInfo.cs
+++ b/Tests/Microsoft.Azure.Mobile.Push.NET/Properties/AssemblyInfo.cs
@@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
diff --git a/Tests/Microsoft.Azure.Mobile.Push.Test.Windows/Properties/AssemblyInfo.cs b/Tests/Microsoft.Azure.Mobile.Push.Test.Windows/Properties/AssemblyInfo.cs
index 3bf85d77d..edba0ca88 100644
--- a/Tests/Microsoft.Azure.Mobile.Push.Test.Windows/Properties/AssemblyInfo.cs
+++ b/Tests/Microsoft.Azure.Mobile.Push.Test.Windows/Properties/AssemblyInfo.cs
@@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
diff --git a/Tests/Microsoft.Azure.Mobile.Push.Test.Windows/PushTest.cs b/Tests/Microsoft.Azure.Mobile.Push.Test.Windows/PushTest.cs
index dc16e1c0c..74db59c69 100644
--- a/Tests/Microsoft.Azure.Mobile.Push.Test.Windows/PushTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Push.Test.Windows/PushTest.cs
@@ -21,11 +21,11 @@ public void InstanceIsNotNull()
[TestMethod]
public void GetEnabled()
{
- Push.Enabled = false;
- Assert.IsFalse(Push.Enabled);
+ Push.SetEnabledAsync(false).Wait();
+ Assert.IsFalse(Push.IsEnabledAsync().Result);
- Push.Enabled = true;
- Assert.IsTrue(Push.Enabled);
+ Push.SetEnabledAsync(true).Wait();
+ Assert.IsTrue(Push.IsEnabledAsync().Result);
}
}
}
diff --git a/Tests/Microsoft.Azure.Mobile.Test.UWP/Microsoft.Azure.Mobile.Test.UWP.csproj b/Tests/Microsoft.Azure.Mobile.Test.UWP/Microsoft.Azure.Mobile.Test.UWP.csproj
index 856de12a1..2a651a38f 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.UWP/Microsoft.Azure.Mobile.Test.UWP.csproj
+++ b/Tests/Microsoft.Azure.Mobile.Test.UWP/Microsoft.Azure.Mobile.Test.UWP.csproj
@@ -95,6 +95,7 @@
+
UnitTestApp.xaml
diff --git a/Tests/Microsoft.Azure.Mobile.Test.UWP/MobileCenterTest.cs b/Tests/Microsoft.Azure.Mobile.Test.UWP/MobileCenterTest.cs
index 3660f7938..e040596fb 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.UWP/MobileCenterTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.UWP/MobileCenterTest.cs
@@ -34,14 +34,17 @@ public void VerifyPlatformId()
[TestMethod]
public void SetCountryCode()
{
- const string CountryCode = "US";
- int informationInvalidated = 0;
- EventHandler OnInformationInvalidated = delegate { informationInvalidated++; };
- DeviceInformationHelper.InformationInvalidated += OnInformationInvalidated;
- MobileCenter.SetCountryCode(CountryCode);
- MobileCenter.SetCountryCode("INVALID");
- DeviceInformationHelper.InformationInvalidated -= OnInformationInvalidated;
- Assert.AreEqual(informationInvalidated, 1);
+ var informationInvalidated = false;
+
+ void InformationInvalidated(object sender, EventArgs e)
+ {
+ informationInvalidated = true;
+ }
+
+ DeviceInformationHelper.InformationInvalidated += InformationInvalidated;
+ MobileCenter.SetCountryCode("US");
+ DeviceInformationHelper.InformationInvalidated -= InformationInvalidated;
+ Assert.AreEqual(informationInvalidated, true);
}
}
}
diff --git a/Tests/Microsoft.Azure.Mobile.Test.UWP/Package.appxmanifest b/Tests/Microsoft.Azure.Mobile.Test.UWP/Package.appxmanifest
index 9a643cde6..5dd661cc2 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.UWP/Package.appxmanifest
+++ b/Tests/Microsoft.Azure.Mobile.Test.UWP/Package.appxmanifest
@@ -7,7 +7,7 @@
+ Version="0.14.0.0" />
diff --git a/Tests/Microsoft.Azure.Mobile.Test.UWP/Properties/AssemblyInfo.cs b/Tests/Microsoft.Azure.Mobile.Test.UWP/Properties/AssemblyInfo.cs
index e85411f5a..6a8696797 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.UWP/Properties/AssemblyInfo.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.UWP/Properties/AssemblyInfo.cs
@@ -14,5 +14,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/Tests/Microsoft.Azure.Mobile.Test.UWP/Utils/DefaultScreenSizeProviderTest.cs b/Tests/Microsoft.Azure.Mobile.Test.UWP/Utils/DefaultScreenSizeProviderTest.cs
new file mode 100644
index 000000000..f010caa56
--- /dev/null
+++ b/Tests/Microsoft.Azure.Mobile.Test.UWP/Utils/DefaultScreenSizeProviderTest.cs
@@ -0,0 +1,43 @@
+using Microsoft.Azure.Mobile.Utils;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Moq;
+using System.Threading.Tasks;
+using Windows.Graphics.Display;
+
+namespace Microsoft.Azure.Mobile.Test.UWP.Utils
+{
+ [TestClass]
+ public class DefaultScreenSizeProviderTest
+ {
+ ///
+ /// Verify screen size changed event is raised on screen size change
+ ///
+ [TestMethod]
+ public void VerifyScreenSizeChangedEventIsRaised()
+ {
+ var screenSizeChanged = false;
+ var screenSizeProvider = new DefaultScreenSizeProvider();
+ screenSizeProvider.ScreenSizeChanged += (sender, args) => { screenSizeChanged = true; };
+
+ screenSizeProvider.UpdateDisplayInformation(1, 1).Wait();
+
+ Assert.IsTrue(screenSizeChanged);
+ }
+
+ ///
+ /// Verify new screen size is set after screen size change
+ ///
+ [TestMethod]
+ public void VerifyNewScreenSizeIsSet()
+ {
+ var newScreenHeight = 1;
+ var newScreenWidth = 2;
+ var screenSizeProvider = new DefaultScreenSizeProvider();
+
+ screenSizeProvider.UpdateDisplayInformation(newScreenHeight, newScreenWidth).Wait();
+
+ Assert.AreEqual(screenSizeProvider.Height, newScreenHeight);
+ Assert.AreEqual(screenSizeProvider.Width, newScreenWidth);
+ }
+ }
+}
diff --git a/Tests/Microsoft.Azure.Mobile.Test.UWP/Utils/DeviceInformationHelperTest.cs b/Tests/Microsoft.Azure.Mobile.Test.UWP/Utils/DeviceInformationHelperTest.cs
index 119648f2d..b11a061da 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.UWP/Utils/DeviceInformationHelperTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.UWP/Utils/DeviceInformationHelperTest.cs
@@ -1,5 +1,7 @@
using Microsoft.Azure.Mobile.Utils;
using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Moq;
+using System;
using System.Threading.Tasks;
namespace Microsoft.Azure.Mobile.Test.UWP.Utils
@@ -29,5 +31,30 @@ public void VerifyCarrierCountry()
var device = Task.Run(() => new DeviceInformationHelper().GetDeviceInformationAsync()).Result;
Assert.AreEqual(device.CarrierCountry, CountryCode);
}
+
+ ///
+ /// Verify screen size provider
+ ///
+ [TestMethod]
+ public void VerifyScreenSizeProvider()
+ {
+ const string testScreenSize = "screen_size";
+ var informationInvalidated = false;
+ var screenSizeProviderMock = new Mock();
+ var screenSizeProviderFactoryMock = new Mock();
+
+ screenSizeProviderMock.Setup(provider => provider.ScreenSize).Returns(testScreenSize);
+ screenSizeProviderFactoryMock.Setup(factory => factory.CreateScreenSizeProvider()).Returns(screenSizeProviderMock.Object);
+ DeviceInformationHelper.SetScreenSizeProviderFactory(screenSizeProviderFactoryMock.Object);
+
+ // Screen size is returned from screen size provider
+ var device = Task.Run(() => new DeviceInformationHelper().GetDeviceInformationAsync()).Result;
+ Assert.AreEqual(device.ScreenSize, testScreenSize);
+
+ // InformationInvalidated is invoked when ScreenSizeChanged event is raised
+ DeviceInformationHelper.InformationInvalidated += (sender, args) => { informationInvalidated = true; };
+ screenSizeProviderMock.Raise(provider => provider.ScreenSizeChanged += null, EventArgs.Empty);
+ Assert.IsTrue(informationInvalidated);
+ }
}
}
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/Channel/ChannelGroupTest.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/Channel/ChannelGroupTest.cs
index b03faa767..fb47e5db0 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/Channel/ChannelGroupTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/Channel/ChannelGroupTest.cs
@@ -148,13 +148,13 @@ public void TestEnableChannelGroup()
{
_channelGroup.AddChannel(mockedChannel);
}
- _channelGroup.SetEnabledAsync(true);
- _channelGroup.SetEnabledAsync(false);
+ _channelGroup.SetEnabled(true);
+ _channelGroup.SetEnabled(false);
foreach (var channelMock in channelMocks.Select(mock => mock as Mock))
{
- channelMock.Verify(channel => channel.SetEnabledAsync(It.Is(p => p)), Times.Once());
- channelMock.Verify(channel => channel.SetEnabledAsync(It.Is(p => !p)), Times.Once());
+ channelMock.Verify(channel => channel.SetEnabled(It.Is(p => p)), Times.Once());
+ channelMock.Verify(channel => channel.SetEnabled(It.Is(p => !p)), Times.Once());
}
}
@@ -162,7 +162,7 @@ public void TestEnableChannelGroup()
public void TestDisposeChannelGroup()
{
_channelGroup.Dispose();
- Assert.ThrowsException(() => _channelGroup.SetEnabledAsync(true));
+ Assert.ThrowsException(() => _channelGroup.SetEnabled(true));
}
///
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/Channel/ChannelTest.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/Channel/ChannelTest.cs
index 6d4e4da0f..427bab509 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/Channel/ChannelTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/Channel/ChannelTest.cs
@@ -63,7 +63,7 @@ public void ChannelEnabledByDefault()
[TestMethod]
public void DisableChannel()
{
- _channel.SetEnabledAsync(false).RunNotAsync();
+ _channel.SetEnabled(false);
Assert.IsFalse(_channel.IsEnabled);
}
@@ -74,8 +74,8 @@ public void DisableChannel()
[TestMethod]
public void EnableChannel()
{
- _channel.SetEnabledAsync(false).RunNotAsync();
- _channel.SetEnabledAsync(true).RunNotAsync();
+ _channel.SetEnabled(false);
+ _channel.SetEnabled(true);
Assert.IsTrue(_channel.IsEnabled);
}
@@ -118,7 +118,7 @@ public void EnqueueMaxLogs()
[TestMethod]
public void EnqueueWhileDisabled()
{
- _channel.SetEnabledAsync(false).RunNotAsync();
+ _channel.SetEnabled(false);
var log = new TestLog();
_channel.EnqueueAsync(log).RunNotAsync();
Assert.IsFalse(SentLogOccurred(1));
@@ -183,7 +183,7 @@ public void ChannelInvokesSendingLogEventAfterEnabling()
_channel.EnqueueAsync(new TestLog()).RunNotAsync();
}
- _channel.SetEnabledAsync(true).RunNotAsync();
+ _channel.SetEnabled(true);
Assert.IsTrue(SendingLogOccurred(MaxLogsPerBatch));
}
@@ -194,7 +194,7 @@ public void ChannelInvokesSendingLogEventAfterEnabling()
[TestMethod]
public void ChannelInvokesFailedToSendLogEventAfterDisabling()
{
- _channel.SetEnabledAsync(false).RunNotAsync();
+ _channel.SetEnabled(false);
for (int i = 0; i < MaxLogsPerBatch; ++i)
{
_channel.EnqueueAsync(new TestLog()).RunNotAsync();
@@ -214,7 +214,7 @@ public void ClearLogs()
_channel.EnqueueAsync(new TestLog()).RunNotAsync();
_channel.ClearAsync().RunNotAsync();
- _channel.SetEnabledAsync(true).RunNotAsync();
+ _channel.SetEnabled(true);
Assert.IsFalse(SendingLogOccurred(1));
}
@@ -226,7 +226,7 @@ public void ClearLogs()
public void DisposeChannelTest()
{
_channel.Dispose();
- Assert.ThrowsExceptionAsync(() => _channel.SetEnabledAsync(true)).RunNotAsync();
+ Assert.ThrowsException(() => _channel.SetEnabled(true));
}
///
@@ -236,7 +236,7 @@ public void DisposeChannelTest()
public void ThrowStorageExceptionInDeleteLogsTime()
{
var storage = new Mock();
- storage.Setup(s => s.DeleteLogsAsync(It.IsAny(), It.IsAny())).Throws();
+ storage.Setup(s => s.DeleteLogs(It.IsAny(), It.IsAny())).Throws();
storage.Setup(s => s.GetLogsAsync(It.IsAny(), It.IsAny(), It.IsAny>())).Returns(Task.FromResult(""));
Mobile.Channel.Channel channel = new Mobile.Channel.Channel("name", 1, _batchTimeSpan, 1, _appSecret, _mockIngestion, storage.Object);
@@ -245,7 +245,7 @@ public void ThrowStorageExceptionInDeleteLogsTime()
channel.ShutdownAsync().RunNotAsync();
channel.EnqueueAsync(new TestLog()).RunNotAsync();
- channel.SetEnabledAsync(true).RunNotAsync();
+ channel.SetEnabled(true);
// Not throw any exception
}
@@ -291,7 +291,7 @@ public void IngestionClosedOnNonRecoverableHttpError()
private void SetChannelWithTimeSpan(TimeSpan timeSpan)
{
_storage = new Mobile.Storage.Storage();
- _storage.DeleteLogsAsync(ChannelName).RunNotAsync();
+ _storage.DeleteLogs(ChannelName);
_channel = new Mobile.Channel.Channel(ChannelName, MaxLogsPerBatch, timeSpan, MaxParallelBatches,
_appSecret, _mockIngestion, _storage);
MakeIngestionCallsSucceed();
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/Ingestion/Models/CustomPropertiesLogTest.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/Ingestion/Models/CustomPropertiesLogTest.cs
index c6914b7f9..8b760a9d7 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/Ingestion/Models/CustomPropertiesLogTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/Ingestion/Models/CustomPropertiesLogTest.cs
@@ -54,8 +54,8 @@ public void SaveCustomPropertiesLog()
};
var storage = new Mobile.Storage.Storage();
- storage.DeleteLogsAsync(StorageTestChannelName).RunNotAsync();
- storage.PutLogAsync(StorageTestChannelName, addedLog).RunNotAsync();
+ storage.DeleteLogs(StorageTestChannelName);
+ storage.PutLog(StorageTestChannelName, addedLog);
var retrievedLogs = new List();
storage.GetLogsAsync(StorageTestChannelName, 1, retrievedLogs).RunNotAsync();
var retrievedLog = retrievedLogs[0] as CustomPropertiesLog;
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/Ingestion/Models/StartServiceLogTest.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/Ingestion/Models/StartServiceLogTest.cs
index 92dc0f03a..4adf559c9 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/Ingestion/Models/StartServiceLogTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/Ingestion/Models/StartServiceLogTest.cs
@@ -62,8 +62,8 @@ public void SaveStartServiceLog()
};
var storage = new Mobile.Storage.Storage();
- storage.DeleteLogsAsync(StorageTestChannelName).RunNotAsync();
- storage.PutLogAsync(StorageTestChannelName, addedLog).RunNotAsync();
+ storage.DeleteLogs(StorageTestChannelName);
+ storage.PutLog(StorageTestChannelName, addedLog);
var retrievedLogs = new List();
storage.GetLogsAsync(StorageTestChannelName, 1, retrievedLogs).RunNotAsync();
var retrievedLog = retrievedLogs[0] as StartServiceLog;
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/MobileCenterServiceTest.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/MobileCenterServiceTest.cs
index a92888961..7c323550a 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/MobileCenterServiceTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/MobileCenterServiceTest.cs
@@ -50,7 +50,7 @@ public void SetEnabledDifferentValueNoChannel()
{
_mockSettings.Setup(settings => settings.GetValue(_testService.PublicEnabledPreferenceKey, It.IsAny()))
.Returns(true);
- MobileCenter.Enabled = true;
+ MobileCenter.SetEnabledAsync(true).Wait();
_testService.InstanceEnabled = false;
_mockSettings.VerifySet(settings => settings[_testService.PublicEnabledPreferenceKey] = false, Times.Once());
@@ -64,7 +64,7 @@ public void EnableServiceWhenMobileCenterIsDisabled()
{
_mockSettings.Setup(settings => settings.GetValue(_testService.PublicEnabledPreferenceKey, It.IsAny()))
.Returns(true);
- MobileCenter.Enabled = false;
+ MobileCenter.SetEnabledAsync(false).Wait();
_testService.InstanceEnabled = true;
@@ -80,7 +80,7 @@ public void SetEnabledSameValue()
_mockSettings.Setup(
settings => settings.GetValue(_testService.PublicEnabledPreferenceKey, It.IsAny()))
.Returns(true);
- MobileCenter.Enabled = true;
+ MobileCenter.SetEnabledAsync(true).Wait();
_testService.InstanceEnabled = true;
@@ -95,13 +95,13 @@ public void SetEnabledDifferentValue()
{
_mockSettings.Setup(settings => settings.GetValue(_testService.PublicEnabledPreferenceKey, It.IsAny()))
.Returns(true);
- MobileCenter.Enabled = true;
+ MobileCenter.SetEnabledAsync(true).Wait();
_testService.OnChannelGroupReady(_mockChannelGroup.Object, string.Empty);
_testService.InstanceEnabled = false;
_mockSettings.VerifySet(settings => settings[_testService.PublicEnabledPreferenceKey] = It.IsAny(), Times.Exactly(2));
- _mockChannel.Verify(channel => channel.SetEnabledAsync(It.IsAny()), Times.Exactly(2));
+ _mockChannel.Verify(channel => channel.SetEnabled(It.IsAny()), Times.Exactly(2));
}
///
@@ -110,7 +110,7 @@ public void SetEnabledDifferentValue()
[TestMethod]
public void OnChannelGroupReady()
{
- MobileCenter.Enabled = true;
+ MobileCenter.SetEnabledAsync(true).Wait();
_mockSettings.Setup(settings => settings.GetValue(_testService.PublicEnabledPreferenceKey, It.IsAny()))
.Returns(true);
_testService.OnChannelGroupReady(_mockChannelGroup.Object, string.Empty);
@@ -120,7 +120,7 @@ public void OnChannelGroupReady()
channelGroup.AddChannel(_testService.PublicChannelName, It.IsAny(), It.IsAny(),
It.IsAny()), Times.Once());
_mockSettings.VerifySet(settings => settings[_testService.PublicEnabledPreferenceKey] = true, Times.Once());
- _mockChannel.Verify(channel => channel.SetEnabledAsync(true), Times.Once());
+ _mockChannel.Verify(channel => channel.SetEnabled(true), Times.Once());
Assert.AreSame(_mockChannelGroup.Object, _testService.PublicChannelGroup);
}
@@ -130,7 +130,7 @@ public void OnChannelGroupReady()
[TestMethod]
public void OnChannelGroupReadyMobileCenterIsDisabled()
{
- MobileCenter.Enabled = false;
+ MobileCenter.SetEnabledAsync(false).Wait();
_mockSettings.Setup(
settings => settings.GetValue(_testService.PublicEnabledPreferenceKey, It.IsAny()))
.Returns(true);
@@ -141,7 +141,7 @@ public void OnChannelGroupReadyMobileCenterIsDisabled()
channelGroup.AddChannel(_testService.PublicChannelName, It.IsAny(), It.IsAny(),
It.IsAny()), Times.Once());
_mockSettings.VerifySet(settings => settings[_testService.PublicEnabledPreferenceKey] = false, Times.Once());
- _mockChannel.Verify(channel => channel.SetEnabledAsync(false), Times.Once());
+ _mockChannel.Verify(channel => channel.SetEnabled(false), Times.Once());
}
///
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/MobileCenterTest.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/MobileCenterTest.cs
index 2ac110548..c6d3cc020 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/MobileCenterTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/MobileCenterTest.cs
@@ -120,8 +120,8 @@ public void GetEnabled()
settingsMock.SetupSequence(settings => settings.GetValue(MobileCenter.EnabledKey, It.IsAny()))
.Returns(true).Returns(false);
- Assert.IsTrue(MobileCenter.Enabled);
- Assert.IsFalse(MobileCenter.Enabled);
+ Assert.IsTrue(MobileCenter.IsEnabledAsync().Result);
+ Assert.IsFalse(MobileCenter.IsEnabledAsync().Result);
settingsMock.Verify(settings => settings.GetValue(MobileCenter.EnabledKey, It.IsAny()),
Times.Exactly(2));
}
@@ -139,12 +139,12 @@ public void SetEnabledSameValue()
.Returns(new Mock().Object);
MobileCenter.Instance = new MobileCenter(settingsMock.Object, new MockChannelGroupFactory(channelGroupMock));
MobileCenter.Start("appsecret", typeof(MockMobileCenterService));
- MobileCenter.Enabled = MobileCenter.Enabled;
+ MobileCenter.SetEnabledAsync(MobileCenter.IsEnabledAsync().Result).Wait();
MockMobileCenterService.Instance.MockInstance.VerifySet(
service => service.InstanceEnabled = It.IsAny(), Times.Never());
settingsMock.VerifySet(settings => settings[MobileCenter.EnabledKey] = It.IsAny(), Times.Never());
- channelGroupMock.Verify(channelGroup => channelGroup.SetEnabledAsync(It.IsAny()), Times.Never());
+ channelGroupMock.Verify(channelGroup => channelGroup.SetEnabled(It.IsAny()), Times.Never());
}
///
@@ -160,13 +160,13 @@ public void SetEnabledDifferentValueAfterConfigure()
.Returns(new Mock().Object);
MobileCenter.Instance = new MobileCenter(settingsMock.Object, new MockChannelGroupFactory(channelGroupMock));
MobileCenter.Start("appsecret", typeof(MockMobileCenterService));
- var setVal = !MobileCenter.Enabled;
- MobileCenter.Enabled = setVal;
+ var setVal = !MobileCenter.IsEnabledAsync().Result;
+ MobileCenter.SetEnabledAsync(setVal).Wait();
MockMobileCenterService.Instance.MockInstance.VerifySet(service => service.InstanceEnabled = setVal,
Times.Once());
settingsMock.VerifySet(settings => settings[MobileCenter.EnabledKey] = setVal, Times.Once());
- channelGroupMock.Verify(channelGroup => channelGroup.SetEnabledAsync(setVal), Times.Once());
+ channelGroupMock.Verify(channelGroup => channelGroup.SetEnabled(setVal), Times.Once());
}
///
@@ -182,7 +182,7 @@ public void SetEnabledDifferentValueBeforeConfigure()
group => group.AddChannel(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()))
.Returns(new Mock().Object);
MobileCenter.Instance = new MobileCenter(settingsMock.Object, new MockChannelGroupFactory(channelGroupMock));
- MobileCenter.Enabled = false;
+ MobileCenter.SetEnabledAsync(false).Wait();
MobileCenter.Start("appsecret", typeof(MockMobileCenterService));
settingsMock.VerifySet(settings => settings[MobileCenter.EnabledKey] = false, Times.Once());
@@ -211,7 +211,7 @@ public void GetInstallId()
var fakeInstallId = Guid.NewGuid();
settings[MobileCenter.InstallIdKey] = fakeInstallId;
MobileCenter.Instance = new MobileCenter(settings);
- var installId = MobileCenter.InstallId;
+ var installId = MobileCenter.GetInstallIdAsync().Result;
Assert.IsTrue(installId.HasValue);
Assert.AreEqual(installId.Value, fakeInstallId);
@@ -496,18 +496,23 @@ public void SetCustomProperties()
group => group.AddChannel(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()))
.Returns(channelUnitMock.Object);
MobileCenter.Instance = new MobileCenter(settingsMock.Object, new MockChannelGroupFactory(channelGroupMock));
+
+ // Set before Mobile Center is configured.
+ MobileCenter.SetCustomProperties(new CustomProperties());
+ channelUnitMock.Verify(channel => channel.EnqueueAsync(It.IsAny()), Times.Never());
+
MobileCenter.Configure("appsecret");
- /* Set null. */
+ // Set null.
MobileCenter.SetCustomProperties(null);
channelUnitMock.Verify(channel => channel.EnqueueAsync(It.IsAny()), Times.Never());
- /* Set empty. */
+ // Set empty.
var empty = new CustomProperties();
MobileCenter.SetCustomProperties(empty);
channelUnitMock.Verify(channel => channel.EnqueueAsync(It.IsAny()), Times.Never());
- /* Set normal. */
+ // Set normal.
var properties = new CustomProperties();
properties.Set("test", "test");
MobileCenter.SetCustomProperties(properties);
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/Properties/AssemblyInfo.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/Properties/AssemblyInfo.cs
index 2cdebe7bb..0ab6c6b4a 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/Properties/AssemblyInfo.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/Properties/AssemblyInfo.cs
@@ -16,5 +16,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.0")]
-[assembly: AssemblyFileVersion("0.13.1.0")]
-[assembly: AssemblyInformationalVersion("0.13.1-SNAPSHOT")]
+[assembly: AssemblyFileVersion("0.14.0.0")]
+[assembly: AssemblyInformationalVersion("0.14.0-SNAPSHOT")]
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/FakeStorageTest.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/FakeStorageTest.cs
index 7bb69b3aa..a73c05463 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/FakeStorageTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/FakeStorageTest.cs
@@ -31,8 +31,8 @@ public void ShutdownTimeout()
// Ignore warnings because we just want to "fire and forget"
#pragma warning disable 4014
- storage.PutLogAsync(StorageTestChannelName, new TestLog());
- storage.PutLogAsync(StorageTestChannelName, new TestLog());
+ storage.PutLog(StorageTestChannelName, new TestLog());
+ storage.PutLog(StorageTestChannelName, new TestLog());
#pragma warning restore 4014
var result = storage.ShutdownAsync(TimeSpan.FromTicks(1)).RunNotAsync();
@@ -54,8 +54,8 @@ public void ShutdownSucceed()
// Ignore warnings because we just want to "fire and forget"
#pragma warning disable 4014
- storage.PutLogAsync(StorageTestChannelName, new TestLog());
- storage.PutLogAsync(StorageTestChannelName, new TestLog());
+ storage.PutLog(StorageTestChannelName, new TestLog());
+ storage.PutLog(StorageTestChannelName, new TestLog());
#pragma warning restore 4014
var result = storage.ShutdownAsync(TimeSpan.FromSeconds(100)).RunNotAsync();
@@ -110,8 +110,8 @@ public void StorageThrowsStorageException()
.Throws(new StorageException());
var fakeStorage = new Mobile.Storage.Storage(mockAdapter.Object);
- Assert.ThrowsException(() => fakeStorage.PutLogAsync("channel_name", new TestLog()).RunNotAsync());
- Assert.ThrowsException(() => fakeStorage.DeleteLogsAsync("channel_name", string.Empty).RunNotAsync());
+ Assert.ThrowsException(() => fakeStorage.PutLog("channel_name", new TestLog()).RunNotAsync());
+ Assert.ThrowsException(() => fakeStorage.DeleteLogs("channel_name", string.Empty).RunNotAsync());
Assert.ThrowsException(() => fakeStorage.CountLogsAsync("channel_name").RunNotAsync());
Assert.ThrowsException(() => fakeStorage.GetLogsAsync("channel_name", 1, new List()).RunNotAsync());
}
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/MockStorage.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/MockStorage.cs
index 8160bb748..14255296b 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/MockStorage.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/MockStorage.cs
@@ -8,7 +8,7 @@ namespace Microsoft.Azure.Mobile.Test.Storage
{
public class MockStorage : IStorage
{
- public Task ClearPendingLogStateAsync(string channelName)
+ public Task ClearPendingLogState(string channelName)
{
return TaskExtension.GetCompletedTask();
}
@@ -18,12 +18,12 @@ public Task CountLogsAsync(string channelName)
return TaskExtension.GetCompletedTask(1);
}
- public Task DeleteLogsAsync(string channelName)
+ public Task DeleteLogs(string channelName)
{
return TaskExtension.GetCompletedTask();
}
- public Task DeleteLogsAsync(string channelName, string batchId)
+ public Task DeleteLogs(string channelName, string batchId)
{
return TaskExtension.GetCompletedTask();
}
@@ -33,7 +33,7 @@ public Task GetLogsAsync(string channelName, int limit, List logs)
return TaskExtension.GetCompletedTask(Guid.NewGuid().ToString());
}
- public Task PutLogAsync(string channelName, Log log)
+ public Task PutLog(string channelName, Log log)
{
return TaskExtension.GetCompletedTask();
}
diff --git a/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/StorageTest.cs b/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/StorageTest.cs
index 930d2989c..d0fbd2b82 100644
--- a/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/StorageTest.cs
+++ b/Tests/Microsoft.Azure.Mobile.Test.Windows/Storage/StorageTest.cs
@@ -15,7 +15,7 @@ public class StorageTest
[TestInitialize]
public void InitializeStorageTest()
{
- _storage.DeleteLogsAsync(StorageTestChannelName).RunNotAsync();
+ _storage.DeleteLogs(StorageTestChannelName);
}
///
@@ -47,7 +47,7 @@ public void CountNonemptyStorage()
public void PutOneLog()
{
var addedLog = TestLog.CreateTestLog();
- _storage.PutLogAsync(StorageTestChannelName, addedLog).RunNotAsync();
+ _storage.PutLog(StorageTestChannelName, addedLog);
var retrievedLogs = new List();
_storage.GetLogsAsync(StorageTestChannelName, 1, retrievedLogs).RunNotAsync();
var retrievedLog = retrievedLogs[0];
@@ -61,7 +61,7 @@ public void PutOneLog()
public void DeleteLogsNoBatchId()
{
PutNLogs(5);
- _storage.DeleteLogsAsync(StorageTestChannelName).RunNotAsync();
+ _storage.DeleteLogs(StorageTestChannelName);
var count = _storage.CountLogsAsync(StorageTestChannelName).RunNotAsync();
Assert.AreEqual(0, count);
}
@@ -77,7 +77,7 @@ public void DeleteLogsWithBatchId()
var addedLogs = PutNLogs(numLogsToAdd);
var retrievedLogs = new List();
var batchId = _storage.GetLogsAsync(StorageTestChannelName, limit, retrievedLogs).RunNotAsync();
- _storage.DeleteLogsAsync(StorageTestChannelName, batchId).RunNotAsync();
+ _storage.DeleteLogs(StorageTestChannelName, batchId);
var numLogsRemaining = _storage.CountLogsAsync(StorageTestChannelName).RunNotAsync();
Assert.AreEqual(numLogsToAdd - retrievedLogs.Count, numLogsRemaining);
}
@@ -177,7 +177,7 @@ public void GetDuplicateLogs()
public void GetLogsFromChannelWithSimilarNames()
{
var fakeChannelName = StorageTestChannelName.Substring(0, StorageTestChannelName.Length - 1);
- _storage.PutLogAsync(StorageTestChannelName, TestLog.CreateTestLog()).RunNotAsync();
+ _storage.PutLog(StorageTestChannelName, TestLog.CreateTestLog());
var retrievedLogs = new List();
var batchId = _storage.GetLogsAsync(fakeChannelName, 1, retrievedLogs).RunNotAsync();
Assert.IsNull(batchId);
@@ -195,7 +195,7 @@ public void ClearPendingState()
var retrievedLogsFirstTry = new List();
var retrievedLogsSecondTry = new List();
_storage.GetLogsAsync(StorageTestChannelName, limit, retrievedLogsFirstTry).RunNotAsync();
- _storage.ClearPendingLogStateAsync(StorageTestChannelName).RunNotAsync();
+ _storage.ClearPendingLogState(StorageTestChannelName);
_storage.GetLogsAsync(StorageTestChannelName, limit, retrievedLogsSecondTry).RunNotAsync();
CollectionAssert.AreEquivalent(addedLogs, retrievedLogsFirstTry);
CollectionAssert.AreEquivalent(addedLogs, retrievedLogsSecondTry);
@@ -209,6 +209,10 @@ public void FailToGetALog()
{
var invalidLogEntry = new Mobile.Storage.Storage.LogEntry { Channel = StorageTestChannelName, Log = "good luck deserializing me!" };
var connection = new SQLiteConnection("Microsoft.Azure.Mobile.Storage");
+
+ // Perform an arbitrary operation and wait on it to complete so that database is free when invalid log
+ // is inserted.
+ _storage.CountLogsAsync(StorageTestChannelName).RunNotAsync();
connection.Insert(invalidLogEntry);
var logs = new List();
var batchId = _storage.GetLogsAsync(StorageTestChannelName, 4, logs).RunNotAsync();
@@ -228,9 +232,8 @@ private List PutNLogs(int n)
{
var testLog = TestLog.CreateTestLog();
addedLogs.Add(testLog);
- putLogTasks[i] = _storage.PutLogAsync(StorageTestChannelName, testLog);
+ putLogTasks[i] = _storage.PutLog(StorageTestChannelName, testLog);
}
- Task.WaitAll(putLogTasks);
return addedLogs;
}
diff --git a/Tests/iOS/Contoso.Forms.Test.iOS.csproj b/Tests/iOS/Contoso.Forms.Test.iOS.csproj
index 6a0284869..34867292c 100644
--- a/Tests/iOS/Contoso.Forms.Test.iOS.csproj
+++ b/Tests/iOS/Contoso.Forms.Test.iOS.csproj
@@ -105,22 +105,22 @@
..\..\packages\Xamarin.Forms.2.3.4.231\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
- ..\..\packages\Microsoft.Azure.Mobile.0.8.2-r0001-f692127\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.dll
+ ..\..\packages\Microsoft.Azure.Mobile.0.13.1-r0012-bc49197\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.dll
- ..\..\packages\Microsoft.Azure.Mobile.0.8.2-r0001-f692127\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.iOS.Bindings.dll
+ ..\..\packages\Microsoft.Azure.Mobile.0.13.1-r0012-bc49197\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.iOS.Bindings.dll
- ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.8.2-r0001-f692127\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll
+ ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.13.1-r0012-bc49197\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll
- ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.8.2-r0001-f692127\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll
+ ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.13.1-r0012-bc49197\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll
- ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.8.2-r0001-f692127\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll
+ ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.13.1-r0012-bc49197\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll
- ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.8.2-r0001-f692127\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll
+ ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.13.1-r0012-bc49197\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll
diff --git a/Tests/iOS/Info.plist b/Tests/iOS/Info.plist
index e4f847c1d..e24b4d62c 100644
--- a/Tests/iOS/Info.plist
+++ b/Tests/iOS/Info.plist
@@ -9,9 +9,9 @@
CFBundleIdentifier
com.contoso.contoso-forms-test
CFBundleShortVersionString
- 0.13.1
+ 0.14.0
CFBundleVersion
- 0.13.1
+ 0.14.0
LSRequiresIPhoneOS
MinimumOSVersion
diff --git a/Tests/iOS/packages.config b/Tests/iOS/packages.config
index 471046b2d..997d4c174 100644
--- a/Tests/iOS/packages.config
+++ b/Tests/iOS/packages.config
@@ -1,8 +1,8 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/build.cake b/build.cake
index f09dd4af9..c78d45bd8 100644
--- a/build.cake
+++ b/build.cake
@@ -53,8 +53,8 @@ var ANDROID_ASSEMBLIES_FOLDER = TEMPORARY_PREFIX + "AndroidAssemblies";
var PCL_ASSEMBLIES_FOLDER = TEMPORARY_PREFIX + "PCLAssemblies";
// Native SDK versions
-var ANDROID_SDK_VERSION = "0.10.0";
-var IOS_SDK_VERSION = "0.10.1";
+var ANDROID_SDK_VERSION = "0.11.1";
+var IOS_SDK_VERSION = "0.11.0";
var PLATFORM_PATHS = new PlatformPaths();
@@ -489,7 +489,11 @@ Task("RestoreTestPackages").Does(() =>
NuGetRestore("./MobileCenter-SDK-Test.sln");
NuGetUpdate("./Tests/Contoso.Forms.Test/packages.config");
NuGetUpdate("./Tests/iOS/packages.config");
- NuGetUpdate("./Tests/Droid/packages.config");
+ NuGetUpdate("./Tests/Droid/packages.config", new NuGetUpdateSettings {
+
+ // workaround for https://stackoverflow.com/questions/44861995/xamarin-build-error-building-target
+ Source = new string[] { EnvironmentVariable("NUGET_URL") }
+ });
}).OnError(HandleError);
// Remove any uploaded nugets from azure storage