Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/4.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaswenz committed Jan 20, 2017
2 parents 76350a3 + 7e52d02 commit 2f40136
Show file tree
Hide file tree
Showing 19 changed files with 339 additions and 28 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# HockeySDK for Xamarin

## Version 4.1.0
## Version 4.1.1
- **Please note:** The HockeyApp Xamarin SDK by default includes the full version of the native HockeySDKs with all features.
For iOS, this means you'll have to include the key `NSPhotoLibraryUsageDescription` in your app's `Info.plist` file - otherwise you risk an App Store rejection. Please read up on our blog on the [reasoning behind this change](https://www.hockeyapp.net/blog/2016/09/13/hockeysdk-ios-4-1-1-macos-tvos-4-1-0.html). This does not apply to the iOS CrashOnly variant of course, as this is not including the feedback feature.
- **Namespace Change** HockeySDK-Android and HockeySDK-iOS bindings moved to HockeyApp.Android and HockeyApp.iOS namespaces, respectively
Expand All @@ -11,8 +11,8 @@ For iOS, this means you'll have to include the key `NSPhotoLibraryUsageDescripti
- .TrackEvent(string eventName, Dictionary<string, string> properties, Dictionary<string, double> measurements)
- CrashManager
- .DidCrashInLastSession
- [changelog](https://github.com/bitstadium/HockeySDK-Xamarin/releases)
- Wraps [HockeySDK-iOS 4.1.1](https://github.com/bitstadium/HockeySDK-iOS/releases/tag/4.1.1) and [HockeySDK-Android 4.1.1](https://github.com/bitstadium/HockeySDK-Android/releases/tag/4.1.1).
- [Changelog](https://github.com/bitstadium/HockeySDK-Xamarin/releases)
- Wraps [HockeySDK-iOS 4.1.3](https://github.com/bitstadium/HockeySDK-iOS/releases/tag/4.1.3) and [HockeySDK-Android 4.1.2](https://github.com/bitstadium/HockeySDK-Android/releases/tag/4.1.2).

## Introduction
HockeySDK-Xamarin implements support for using HockeyApp in your iOS and Android applications.
Expand Down
20 changes: 10 additions & 10 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
#addin nuget:?package=Cake.Xamarin
#addin nuget:?package=Cake.FileHelpers

var COMPONENT_VERSION = "4.1.0.3";
var NUGET_VERSION = "4.1.0";
var COMPONENT_VERSION = "4.1.1.0";
var NUGET_VERSION = "4.1.1";

var ANDROID_URL = "https://download.hockeyapp.net/sdk/xamarin/android/HockeySDK-Android-4.1.1.zip";
var IOS_URL = "https://download.hockeyapp.net/sdk/xamarin/ios/HockeySDK-iOS-4.1.1.zip";
var ANDROID_URL = "https://download.hockeyapp.net/sdk/android/HockeySDK-Android-4.1.2.zip";
var IOS_URL = "https://download.hockeyapp.net/sdk/ios/HockeySDK-iOS-4.1.3.zip";

var SAMPLES = new [] {
"./samples/HockeyAppSampleAndroid.sln",
// "./samples/HockeyAppSampleiOS.sln",
// "./samples/HockeyAppSampleiOSCrashOnly.sln",
// "./samples/HockeyAppSampleForms.sln",
"./samples/HockeyAppSampleiOS.sln",
"./samples/HockeyAppSampleiOSCrashOnly.sln",
"./samples/HockeyAppSampleForms.sln",
};

var TARGET = Argument ("target", Argument ("t", "all"));
Expand Down Expand Up @@ -68,10 +68,10 @@ Task ("externals-ios")
DownloadFile (IOS_URL, "./externals/ios/hockeyapp.ios.zip");
Unzip ("./externals/ios/hockeyapp.ios.zip", "./externals/ios/");

CopyFile ("./externals/ios/HockeySDK-iOS/HockeySDKAllFeatures/HockeySDK.embeddedframework/HockeySDK.framework/Versions/A/HockeySDK", "./externals/ios/libHockeySDK.a");
CopyFile ("./externals/ios/HockeySDK-iOS/HockeySDKCrashOnly/HockeySDK.framework/Versions/A/HockeySDK", "./externals/ios/libHockeySDKCrashOnly.a");
CopyFile ("./externals/ios/HockeySDK-iOS/HockeySDKAllFeatures/HockeySDK.embeddedframework/HockeySDK.framework/HockeySDK", "./externals/ios/libHockeySDK.a");
CopyFile ("./externals/ios/HockeySDK-iOS/HockeySDKCrashOnly/HockeySDK.framework/HockeySDK", "./externals/ios/libHockeySDKCrashOnly.a");

CopyDirectory ("./externals/ios/HockeySDK-iOS/HockeySDKAllFeatures/HockeySDK.embeddedframework/HockeySDK.framework/Versions/A/Resources/HockeySDKResources.bundle", "./externals/ios/HockeySDKResources.bundle");
CopyDirectory ("./externals/ios/HockeySDK-iOS/HockeySDKAllFeatures/HockeySDK.embeddedframework/HockeySDKResources.bundle", "./externals/ios/HockeySDKResources.bundle");
});

// Create a common externals task depending on platform specific ones
Expand Down
2 changes: 1 addition & 1 deletion component/android/Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The following features are currently supported:

1. **Collect crash reports:** If your app crashes, a crash log is written to the device's storage. If the user starts the app again, they will be asked asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to the App Store. Crash logs contain viable information for you to help resolve the issue. Furthermore, you as a developer can add additional information to the report as well.

2. **User Metrics**: Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count. If you are part of [Preseason][https://hockeyapp.net/preseason], you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal. User Metrics requires a minimum API level of 14 (Android 4.x Ice Cream Sandwich).
2. **User Metrics**: Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count. You can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal. User Metrics requires a minimum API level of 14 (Android 4.x Ice Cream Sandwich).

3. **Update Ad-Hoc / Enterprise apps:** The app will check with HockeyApp if a new version for your Ad-Hoc or Enterprise build is available. If yes, it will show an alert view to the user and let him see the release notes, the version history and start the installation process right away.

Expand Down
43 changes: 43 additions & 0 deletions component/android/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,49 @@ namespace YourNameSpace
}
```

## Add User Metrics

HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom.

- **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more.
- **Users**: The SDK anonymously tracks the users of your app by creating a random UUID.

On Android, User Metrics is not automatically gathered, you have to start this manually:

```csharp
// add the HockeyApp namespace
using HockeyApp.Android.Metrics;

// in your main activity OnCreate-method add:
MetricsManager.Register(this, Application, "$Your_App_Id");
```

## Add Custom Events

HockeyApp allows you to track custom events to understand user actions inside your app.

**Please note:** To use custom events, please first make sure that User Metrics is set up correctly, e.g. you registered the MetricsManager.

1. Make sure to add the correct namespace:
```csharp
using HockeyApp;
using System.Collections.Generic;
```

2. Track custom events like this:
```csharp
HockeyApp.MetricsManager.TrackEvent("Custom Event");
```
if you want to add custom properties or measurements, use this:

```csharp
HockeyApp.MetricsManager.TrackEvent(
"Custom Event",
new Dictionary<string, string> { { "property", "value" } },
new Dictionary<string, double> { { "time", 1.0 } }
)
```

## Add Update Distribution

This will add the in-app update mechanism to your app.
Expand Down
2 changes: 1 addition & 1 deletion component/forms/Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The following features are currently supported:

1. **Collect crash reports:** If your app crashes, a crash log is written to the device's storage. If the user starts the app again, they will be asked asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to the App Store. Crash logs contain viable information for you to help resolve the issue. Furthermore, you as a developer can add additional information to the report as well.

2. **User Metrics**: Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count. If you are part of [Preseason][https://hockeyapp.net/preseason], you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal.
2. **User Metrics**: Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count. You can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal.

3. **Update Ad-Hoc / Enterprise apps:** The app will check with HockeyApp if a new version for your Ad-Hoc or Enterprise build is available. If yes, it will show an alert view to the user and let him see the release notes, the version history and start the installation process right away.

Expand Down
92 changes: 89 additions & 3 deletions component/forms/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,52 @@ namespace YourNameSpace
}
```

## User Metrics

HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom.

- **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more.
- **Users**: The SDK anonymously tracks the users of your app by creating a random UUID.

On iOS the random UUID securely stored in the keychain, so that it persist across reinstallations. On iOS, User Metrics is enabled by default. If you want to turn off User Metrics, follow this code:

```csharp
// add the HockeyApp namespace
using HockeyApp.iOS;

// in your FinishedLaunching-method add:
var manager = BITHockeyManager.SharedHockeyManager;
manager.Configure("$Your_App_Id");
manager.DisableMetricsManager = true;
manager.StartManager();
```

It is important that you set `DisableMetricsManager` before you start the manager.

## Custom Events

HockeyApp allows you to track custom events to understand user actions inside your app.

1. Make sure to add the correct namespace:
```csharp
using HockeyApp;
using System.Collections.Generic;
```

2. Track custom events like this:
```csharp
HockeyApp.MetricsManager.TrackEvent("Custom Event");
```
if you want to add custom properties or measurements, use this:

```csharp
HockeyApp.MetricsManager.TrackEvent(
"Custom Event",
new Dictionary<string, string> { { "property", "value" } },
new Dictionary<string, double> { { "time", 1.0 } }
)
```


## Add Update Distribution

Expand All @@ -78,9 +124,6 @@ manager.StartManager();

If you want to see beta analytics, use the beta distribution feature with in-app updates, restrict versions to specific users, or want to know who is actually testing your app, you need to follow the instructions on our guide [Authenticating Users on iOS](https://support.hockeyapp.net/kb/client-integration-ios-mac-os-x-tvos/authenticating-users-on-ios)




## Add in-app feedback

This will add the ability for your users to provide feedback from right inside your app.
Expand Down Expand Up @@ -181,6 +224,49 @@ namespace YourNameSpace
}
```

## Add User Metrics

HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom.

- **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more.
- **Users**: The SDK anonymously tracks the users of your app by creating a random UUID.

On Android, User Metrics is not automatically gathered, you have to start this manually:

```csharp
// add the HockeyApp namespace
using HockeyApp.Android.Metrics;

// in your main activity OnCreate-method add:
MetricsManager.Register(this, Application, "$Your_App_Id");
```

## Add Custom Events

HockeyApp allows you to track custom events to understand user actions inside your app.

**Please note:** To use custom events, please first make sure that User Metrics is set up correctly, e.g. you registered the MetricsManager.

1. Make sure to add the correct namespace:
```csharp
using HockeyApp;
using System.Collections.Generic;
```

2. Track custom events like this:
```csharp
HockeyApp.MetricsManager.TrackEvent("Custom Event");
```
if you want to add custom properties or measurements, use this:

```csharp
HockeyApp.MetricsManager.TrackEvent(
"Custom Event",
new Dictionary<string, string> { { "property", "value" } },
new Dictionary<string, double> { { "time", 1.0 } }
)
```

## Add Update Distribution

This will add the in-app update mechanism to your app.
Expand Down
2 changes: 1 addition & 1 deletion component/ios/Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The following features are currently supported:

1. **Collect crash reports:** If your app crashes, a crash log is written to the device's storage. If the user starts the app again, they will be asked asked to submit the crash report to HockeyApp. This works for both beta and live apps, i.e. those submitted to the App Store. Crash logs contain viable information for you to help resolve the issue. Furthermore, you as a developer can add additional information to the report as well.

2. **User Metrics**: Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count. If you are part of [Preseason][https://hockeyapp.net/preseason], you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal.
2. **User Metrics**: Understand user behavior to improve your app. Track usage through daily and monthly active users, monitor crash impacted users, as well as customer engagement through session count. You can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal.

3. **Update Ad-Hoc / Enterprise apps:** The app will check with HockeyApp if a new version for your Ad-Hoc or Enterprise build is available. If yes, it will show an alert view to the user and let him see the release notes, the version history and start the installation process right away.

Expand Down
46 changes: 46 additions & 0 deletions component/ios/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,52 @@ namespace YourNameSpace
}
```

## User Metrics

HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom.

- **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more.
- **Users**: The SDK anonymously tracks the users of your app by creating a random UUID.

On iOS the random UUID securely stored in the keychain, so that it persist across reinstallations. On iOS, User Metrics is enabled by default. If you want to turn off User Metrics, follow this code:

```csharp
// add the HockeyApp namespace
using HockeyApp.iOS;

// in your FinishedLaunching-method add:
var manager = BITHockeyManager.SharedHockeyManager;
manager.Configure("$Your_App_Id");
manager.DisableMetricsManager = true;
manager.StartManager();
```

It is important that you set `DisableMetricsManager` before you start the manager.

## Custom Events

HockeyApp allows you to track custom events to understand user actions inside your app.

1. Make sure to add the correct namespace:
```csharp
using HockeyApp;
using System.Collections.Generic;
```

2. Track custom events like this:
```csharp
HockeyApp.MetricsManager.TrackEvent("Custom Event");
```
if you want to add custom properties or measurements, use this:

```csharp
HockeyApp.MetricsManager.TrackEvent(
"Custom Event",
new Dictionary<string, string> { { "property", "value" } },
new Dictionary<string, double> { { "time", 1.0 } }
)
```


## Add Update Distribution

Expand Down
2 changes: 1 addition & 1 deletion samples/HockeyAppSampleForms/Droid/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected override void OnCreate (Bundle bundle)
//Register to with the Update Manager
UpdateManager.Register (this, HOCKEYAPP_APPID);

MetricsManager.Register (this, Application, HOCKEYAPP_APPID);
MetricsManager.Register (Application, HOCKEYAPP_APPID);

var showFeedbackButton = new Xamarin.Forms.Button {
Text = "Show Feedback"
Expand Down
4 changes: 2 additions & 2 deletions source/HockeySDK.Android/HockeySDK.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<AssemblyName>HockeySDK</AssemblyName>
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
6 changes: 6 additions & 0 deletions source/HockeySDK.Android/PlatformCrashManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ internal class PlatformCrashManager : IPlatformCrashManager
public PlatformCrashManager() {}

public bool DidCrashInLastSession { get { return HockeyAndroid.CrashManager.DidCrashInLastSession(); } }

public bool TerminateOnUnobservedTaskException {

get { return HockeyAndroid.CrashManager.TerminateOnUnobservedTaskException; }
set { HockeyAndroid.CrashManager.TerminateOnUnobservedTaskException = value; }
}
}
}

9 changes: 8 additions & 1 deletion source/HockeySDK.AndroidBindings/Additions/CrashManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ public partial class CrashManager
{
private static bool connectedToUnhandledExceptionEvents = false;
private static readonly object crashManagerLock = new object();
private static bool terminateOnUnobservedTaskException;

public static bool TerminateOnUnobservedTaskException
{
get { return terminateOnUnobservedTaskException; }
set { terminateOnUnobservedTaskException = value; }
}

public static void Register(global::Android.Content.Context context)
{
Expand Down Expand Up @@ -54,7 +61,7 @@ private static void ConnectUnhandledExceptionEvents(global::HockeyApp.Android.Cr

AndroidEnvironment.UnhandledExceptionRaiser += (sender, e) => TraceWriter.WriteTrace(e.Exception);
AppDomain.CurrentDomain.UnhandledException += (sender, e) => TraceWriter.WriteTrace(e.ExceptionObject);
TaskScheduler.UnobservedTaskException += (sender, e) => TraceWriter.WriteTrace(e.Exception);
TaskScheduler.UnobservedTaskException += (sender, e) => TraceWriter.WriteTrace(e.Exception, terminateOnUnobservedTaskException);

connectedToUnhandledExceptionEvents = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<RootNamespace>HockeyApp.Android</RootNamespace>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<AssemblyName>HockeySDK.AndroidBindings</AssemblyName>
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<JavaDocPaths>Jars\HockeySDK-Android\docs</JavaDocPaths>
Expand Down
5 changes: 5 additions & 0 deletions source/HockeySDK.Shared/CrashManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public static class CrashManager
/// </summary>
/// <value><c>true</c> if did crash in last session; otherwise, <c>false</c>.</value>
public static bool DidCrashInLastSession { get { return PlatformCrashManager.DidCrashInLastSession; } }
public static bool TerminateOnUnobservedTaskException
{
get { return PlatformCrashManager.TerminateOnUnobservedTaskException; }
set { PlatformCrashManager.TerminateOnUnobservedTaskException = value; }
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace HockeyApp
internal interface IPlatformCrashManager
{
bool DidCrashInLastSession { get; }
bool TerminateOnUnobservedTaskException { get; set; }
}
}

Loading

0 comments on commit 2f40136

Please sign in to comment.