From 61c3056a54ed6dae7d82ba5084777b9ec3ea89c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Fri, 3 Jun 2016 12:32:54 +0200 Subject: [PATCH 01/20] Use proper link to always download the latest nuget.exe version --- bootstrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrapper.sh b/bootstrapper.sh index bf063a6..c79b1e6 100644 --- a/bootstrapper.sh +++ b/bootstrapper.sh @@ -52,7 +52,7 @@ fi # Download NuGet if it does not exist. if [ ! -f $NUGET_EXE ]; then echo "Downloading NuGet..." - curl -Lsfo $NUGET_EXE https://www.nuget.org/nuget.exe + curl -Lsfo $NUGET_EXE https://dist.nuget.org/win-x86-commandline/latest/nuget.exe if [ $? -ne 0 ]; then echo "An error occured while downloading nuget.exe." exit 1 From 591822fc419a5945a606304ff1929c7396433a2f Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Tue, 6 Sep 2016 17:04:17 +0200 Subject: [PATCH 02/20] Add api definition for iOS binding --- source/HockeySDK.iOSBindings/ApiDefinition.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/HockeySDK.iOSBindings/ApiDefinition.cs b/source/HockeySDK.iOSBindings/ApiDefinition.cs index d2bfb09..c015f65 100644 --- a/source/HockeySDK.iOSBindings/ApiDefinition.cs +++ b/source/HockeySDK.iOSBindings/ApiDefinition.cs @@ -259,6 +259,10 @@ public partial interface BITMetricsManager [Export ("trackEventWithName:")] void TrackEvent (string eventName); + // - (void)trackEventWithName:(nonnull NSString *)eventName properties:(nullable NSDictionary *)properties measurements:(nullable NSDictionary *)measurements; + [Export("trackEventWithName:properties:measurements:")] + void TrackEvent(string eventName, NSDictionary properties, NSDictionary measurements); + [Export ("serverURL", ArgumentSemantic.Retain)] string ServerURL { get; set; } } From d59237c35865c54c281a3d94e7cad528948509f6 Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Tue, 6 Sep 2016 17:06:49 +0200 Subject: [PATCH 03/20] Use latest iOS and Android SDKs when building --- build.cake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.cake b/build.cake index 4fe1bdf..c0b4134 100644 --- a/build.cake +++ b/build.cake @@ -5,8 +5,8 @@ var COMPONENT_VERSION = "4.1.0.2"; var NUGET_VERSION = "4.1.0-beta3"; -var ANDROID_URL = "https://download.hockeyapp.net/sdk/xamarin/android/HockeySDK-Android-4.1.0-beta.2.zip"; -var IOS_URL = "https://download.hockeyapp.net/sdk/xamarin/ios/HockeySDK-iOS-4.1.0-beta.2.zip"; +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.0.zip"; var SAMPLES = new [] { "./samples/HockeyAppSampleAndroid.sln", From 7c2a42dad4d70e8c26ba592eadf488f25e9841bc Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Tue, 6 Sep 2016 17:07:06 +0200 Subject: [PATCH 04/20] Make bootstrapper script executable --- bootstrapper.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 bootstrapper.sh diff --git a/bootstrapper.sh b/bootstrapper.sh old mode 100644 new mode 100755 From b6bc352763aa6509f59ecb3f4c46981f6c56a97d Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Tue, 6 Sep 2016 17:12:07 +0200 Subject: [PATCH 05/20] Add track event API to all different metrics managers --- .../PlatformMetricsManager.cs | 12 ++++++++++ .../Interfaces/IPlatformMetricsManager.cs | 3 +++ source/HockeySDK.Shared/MetricsManager.cs | 12 ++++++++++ .../HockeySDK.iOS/PlatformMetricsManager.cs | 24 +++++++++++++++++++ source/HockeySDK/PlatformMetricsManager.cs | 6 +++++ 5 files changed, 57 insertions(+) diff --git a/source/HockeySDK.Android/PlatformMetricsManager.cs b/source/HockeySDK.Android/PlatformMetricsManager.cs index 78f57e7..35df61a 100644 --- a/source/HockeySDK.Android/PlatformMetricsManager.cs +++ b/source/HockeySDK.Android/PlatformMetricsManager.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using HockeyMetrics = HockeyApp.Android.Metrics; namespace HockeyApp @@ -52,6 +53,17 @@ public void TrackEvent(string eventName) { HockeyMetrics.MetricsManager.TrackEvent(eventName); } + + public void TrackEvent(string eventName, Dictionary properties, Dictionary measurements) + { + var measurementsHelper = new Dictionary(); + foreach (KeyValuePair pair in measurements) + { + measurementsHelper.Add(pair.Key, new Java.Lang.Double(pair.Value)); + } + HockeyMetrics.MetricsManager.TrackEvent(eventName, properties, measurementsHelper); + } + } } diff --git a/source/HockeySDK.Shared/Interfaces/IPlatformMetricsManager.cs b/source/HockeySDK.Shared/Interfaces/IPlatformMetricsManager.cs index 2c88cf0..d9297f4 100644 --- a/source/HockeySDK.Shared/Interfaces/IPlatformMetricsManager.cs +++ b/source/HockeySDK.Shared/Interfaces/IPlatformMetricsManager.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace HockeyApp { @@ -7,6 +8,8 @@ internal interface IPlatformMetricsManager bool Disabled { get; set; } void TrackEvent(string eventName); + + void TrackEvent(string eventName, Dictionary properties, Dictionary measurements); } } diff --git a/source/HockeySDK.Shared/MetricsManager.cs b/source/HockeySDK.Shared/MetricsManager.cs index dd6559a..0465aca 100644 --- a/source/HockeySDK.Shared/MetricsManager.cs +++ b/source/HockeySDK.Shared/MetricsManager.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace HockeyApp { @@ -34,6 +35,17 @@ public static void TrackEvent(string eventName) { PlatformMetricsManager.TrackEvent(eventName); } + + /// + /// This method allows to track an event that happened in your app. Remember to choose meaningful event names to have the best experience when diagnosing your app in the HockeyApp web portal. + /// + /// The event’s name as a string. + /// A dictionary of properties to attach to the event. + /// A dictionary of measurements to attach to the event. + public static void TrackEvent(string eventName, Dictionary properties, Dictionary measurements) + { + PlatformMetricsManager.TrackEvent(eventName, properties, measurements); + } } } diff --git a/source/HockeySDK.iOS/PlatformMetricsManager.cs b/source/HockeySDK.iOS/PlatformMetricsManager.cs index 6903f10..dd92231 100644 --- a/source/HockeySDK.iOS/PlatformMetricsManager.cs +++ b/source/HockeySDK.iOS/PlatformMetricsManager.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using HockeyApp.iOS; +using Foundation; namespace HockeyApp { @@ -17,6 +19,28 @@ public void TrackEvent(string eventName) { BITHockeyManager.SharedHockeyManager.MetricsManager.TrackEvent(eventName); } + + public void TrackEvent(string eventName, Dictionary properties, Dictionary measurements) + { + var propertiesHelper = new NSMutableDictionary(); + foreach (KeyValuePair pair in properties) + { + propertiesHelper.Add(NSString.FromObject(pair.Key), NSString.FromObject(pair.Value)); + } + + var measurementsHelper = new NSMutableDictionary(); + foreach (KeyValuePair pair in measurements) + { + measurementsHelper.Add(NSString.FromObject(pair.Key), NSNumber.FromDouble(pair.Value)); + } + + + BITHockeyManager.SharedHockeyManager.MetricsManager.TrackEvent(eventName, + propertiesHelper, + measurementsHelper); + } + + } } diff --git a/source/HockeySDK/PlatformMetricsManager.cs b/source/HockeySDK/PlatformMetricsManager.cs index fd0a448..cfdea0d 100644 --- a/source/HockeySDK/PlatformMetricsManager.cs +++ b/source/HockeySDK/PlatformMetricsManager.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace HockeyApp { @@ -16,6 +17,11 @@ public void TrackEvent(string eventName) { throw new NotImplementedException(PCL.BaitWithoutSwitchMessage); } + + public void TrackEvent(string eventName, Dictionary properties, Dictionary measurements) + { + throw new NotImplementedException(PCL.BaitWithoutSwitchMessage); + } } } From f58b743583ffccc543ae9d401184948b21be1d04 Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Tue, 6 Sep 2016 17:23:57 +0200 Subject: [PATCH 06/20] =?UTF-8?q?=E2=86=92=20beta=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.cake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.cake b/build.cake index c0b4134..ce34208 100644 --- a/build.cake +++ b/build.cake @@ -2,8 +2,8 @@ #addin nuget:?package=Cake.Xamarin #addin nuget:?package=Cake.FileHelpers -var COMPONENT_VERSION = "4.1.0.2"; -var NUGET_VERSION = "4.1.0-beta3"; +var COMPONENT_VERSION = "4.1.0.3"; +var NUGET_VERSION = "4.1.0-beta4"; 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.0.zip"; From cd9e60264a31223a12cccfaf2ef35a4ecb282413 Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Tue, 6 Sep 2016 17:24:43 +0200 Subject: [PATCH 07/20] Fix file target pathes for OS X --- HockeySDK.nuspec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/HockeySDK.nuspec b/HockeySDK.nuspec index 7d38fee..047b8ed 100644 --- a/HockeySDK.nuspec +++ b/HockeySDK.nuspec @@ -18,15 +18,15 @@ - + - - + + - - + + From acce6666748da6f3ae504917ba07b3745d66db42 Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Thu, 8 Sep 2016 15:09:35 +0200 Subject: [PATCH 08/20] Fix possible null references --- .../PlatformMetricsManager.cs | 11 ++++++--- .../HockeySDK.iOS/PlatformMetricsManager.cs | 23 ++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/source/HockeySDK.Android/PlatformMetricsManager.cs b/source/HockeySDK.Android/PlatformMetricsManager.cs index 35df61a..a0c6d07 100644 --- a/source/HockeySDK.Android/PlatformMetricsManager.cs +++ b/source/HockeySDK.Android/PlatformMetricsManager.cs @@ -56,11 +56,16 @@ public void TrackEvent(string eventName) public void TrackEvent(string eventName, Dictionary properties, Dictionary measurements) { - var measurementsHelper = new Dictionary(); - foreach (KeyValuePair pair in measurements) + Dictionary measurementsHelper = null; + if (measurements != null) { - measurementsHelper.Add(pair.Key, new Java.Lang.Double(pair.Value)); + measurementsHelper = new Dictionary(); + foreach (KeyValuePair pair in measurements) + { + measurementsHelper.Add(pair.Key, new Java.Lang.Double(pair.Value)); + } } + HockeyMetrics.MetricsManager.TrackEvent(eventName, properties, measurementsHelper); } diff --git a/source/HockeySDK.iOS/PlatformMetricsManager.cs b/source/HockeySDK.iOS/PlatformMetricsManager.cs index dd92231..032b884 100644 --- a/source/HockeySDK.iOS/PlatformMetricsManager.cs +++ b/source/HockeySDK.iOS/PlatformMetricsManager.cs @@ -22,19 +22,26 @@ public void TrackEvent(string eventName) public void TrackEvent(string eventName, Dictionary properties, Dictionary measurements) { - var propertiesHelper = new NSMutableDictionary(); - foreach (KeyValuePair pair in properties) + NSMutableDictionary propertiesHelper = null; + if (properties != null) { - propertiesHelper.Add(NSString.FromObject(pair.Key), NSString.FromObject(pair.Value)); + propertiesHelper = new NSMutableDictionary(); + foreach (KeyValuePair pair in properties) + { + propertiesHelper.Add(NSString.FromObject(pair.Key), NSString.FromObject(pair.Value)); + } } - var measurementsHelper = new NSMutableDictionary(); - foreach (KeyValuePair pair in measurements) + NSMutableDictionary measurementsHelper = null; + if (measurements != null) { - measurementsHelper.Add(NSString.FromObject(pair.Key), NSNumber.FromDouble(pair.Value)); + measurementsHelper = new NSMutableDictionary(); + foreach (KeyValuePair pair in measurements) + { + measurementsHelper.Add(NSString.FromObject(pair.Key), NSNumber.FromDouble(pair.Value)); + } } - - + BITHockeyManager.SharedHockeyManager.MetricsManager.TrackEvent(eventName, propertiesHelper, measurementsHelper); From 3233bd4a8c67b67de998bc329b55e3d9ddaff6ea Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Thu, 8 Sep 2016 18:07:56 +0200 Subject: [PATCH 09/20] Add NullAllowed references --- source/HockeySDK.iOSBindings/ApiDefinition.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/HockeySDK.iOSBindings/ApiDefinition.cs b/source/HockeySDK.iOSBindings/ApiDefinition.cs index c015f65..9270be8 100644 --- a/source/HockeySDK.iOSBindings/ApiDefinition.cs +++ b/source/HockeySDK.iOSBindings/ApiDefinition.cs @@ -261,7 +261,7 @@ public partial interface BITMetricsManager // - (void)trackEventWithName:(nonnull NSString *)eventName properties:(nullable NSDictionary *)properties measurements:(nullable NSDictionary *)measurements; [Export("trackEventWithName:properties:measurements:")] - void TrackEvent(string eventName, NSDictionary properties, NSDictionary measurements); + void TrackEvent(string eventName, [NullAllowed] NSDictionary properties, [NullAllowed] NSDictionary measurements); [Export ("serverURL", ArgumentSemantic.Retain)] string ServerURL { get; set; } From fd84d00e1fa53d579ac1404e0510c40a6ac0dbb4 Mon Sep 17 00:00:00 2001 From: Matthias Wenz Date: Tue, 13 Sep 2016 13:40:17 +0200 Subject: [PATCH 10/20] Update documentation --- README.md | 146 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 80 insertions(+), 66 deletions(-) diff --git a/README.md b/README.md index 50f7c2a..b4a431f 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ ## Introduction HockeySDK-Xamarin implements support for using HockeyApp in your iOS and Android applications. -Please refer to [HockeySDK-iOS](https://github.com/bitstadium/HockeySDK-iOS) and [HockeySDK-Android](https://github.com/bitstadium/HockeySDK-Android) for advanced platform-specific behaviours +Please refer to the respective platform SDKs [HockeySDK-iOS](https://github.com/bitstadium/HockeySDK-iOS) and [HockeySDK-Android](https://github.com/bitstadium/HockeySDK-Android) for advanced platform-specific behaviors 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. Measure customer engagement through session count. This feature 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. Measure customer engagement through session count. You can also track custom events and view the aggregate results on the HockeyApp dashboard. On Android, this feature 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. @@ -51,11 +51,6 @@ This document contains the following sections: 2. [Contributor license](#contributor-license) 7. [Contact](#contact) -Currently, the following platforms are supported: - - - Xamarin.iOS - - Xamarin.iOS (Crash Only) - - Xamarin.Android ## 1. Requirements @@ -63,6 +58,12 @@ Currently, the following platforms are supported: 1. We assume that you have a project in Xamarin Studio, or Xamarin for Visual Studio. 2. We assume you are not using other crash-analytic services on the same mobile application simultaneously. +Currently, the following platforms are supported: + + - Xamarin.iOS + - Xamarin.Android + + ## 2. Setup @@ -73,14 +74,14 @@ Please see the "[How to create a new app](http://support.hockeyapp.net/kb/about- ### 2.2 Integrate the SDK -For each iOS and Android project desired, add the HockeySDK-Xamarin nuget. +For each iOS and Android project desired, add the HockeySDK-Xamarin nuget package. #### For Xamarin Studio -1. Navigate `Project->Add NuGet Packages...` -2. Search `HockeySDK.Xamarin` (enable show pre-release packages) +1. Navigate to `Project -> Add NuGet Packages...` +2. Search for `HockeySDK.Xamarin` (enable pre-release packages) #### For Xamarin for Visual Studio -1. Navigate `Project->Manage NuGet Packages...` +1. Navigate `Project -> Manage NuGet Packages...` 2. Search `HockeySDK.Xamarin` (enable include prerelease) @@ -91,7 +92,7 @@ This will add crash reporting capabilities to your app. Advanced ways to configu 1. Open your `AppDelegate.cs` file. 2. Add the following lines: -```C# +```csharp using HockeyApp.iOS; namespace YourNameSpace { @@ -101,7 +102,7 @@ namespace YourNameSpace { public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { var manager = BITHockeyManager.SharedHockeyManager; - manager.Configure("Your_App_Id"); + manager.Configure("$Your_App_Id"); manager.StartManager(); manager.Authenticator.AuthenticateInstallation(); // This line is obsolete in crash only builds } @@ -109,11 +110,13 @@ namespace YourNameSpace { } ``` +Please make sure to replace `$Your_App_Id` with the app identifier of your app, otherwise it will not work. + #### For Android 1. Open your `MainActivity.cs` file. 2. Add the following lines: -```C# +```csharp using HockeyApp.Android; namespace YourNameSpace { @@ -123,80 +126,91 @@ namespace YourNameSpace { protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // ... your own OnCreate implementation - CrashManager.Register(this, "Your-App-Id"); + CrashManager.Register(this, "$Your_App_Id"); } } } ``` -When the app is resumed, the crash manager is triggered and checks if a new crash was created before. If yes, it presents a dialog to ask the user whether they want to send the crash log to HockeyApp. On app launch the crash manager registers a new exception handler to recognize app crashes. +Please make sure to replace `$Your_App_Id` with the app identifier of your app, otherwise it will not work. + +When the app is resumed, the crash manager is triggered and checks if a new crash was created in a previous session. If yes, it presents a dialog to ask the user whether they want to send the crash log to HockeyApp. On app launch the crash manager registers a new exception handler to recognize app crashes. ### 2.4 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 that is then securely stored in the iOS keychain. Because this anonymous ID is stored in the keychain it persists across reinstallations. +- **Users**: The SDK anonymously tracks the users of your app by creating a random UUID. -Just in case you want to opt-out of this feature, there is a way to turn this functionality off: +#### For iOS +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: -#### For iOS -```C# +```csharp +// add the HockeyApp namespace using HockeyApp.iOS; +// in your FinishedLaunching-method add: var manager = BITHockeyManager.SharedHockeyManager; -manager.Configure("Your_App_Id"); +manager.Configure("$Your_App_Id"); manager.DisableMetricsManager = true; manager.StartManager(); ``` -Android does not automatically start the MetricsManager: +It is important that you set `DisableMetricsManager` before you start the manager. #### For Android -```C# + +On Android, User Metrics is not automatically gathered, you have to start this manually: + +```csharp +// add the HockeyApp namespace using HockeyApp.Android.Metrics; -MetricsManager.Register(this, Application, "Your-App-Id"); +// in your main activity OnCreate-method add: +MetricsManager.Register(this, Application, "$Your_App_Id"); ``` ### 2.5 Add Update Distribution -This will add the in-app update mechanism to your app. Detailed configuration options are in advanced setup: [iOS](https://github.com/bitstadium/HockeySDK-iOS#advancedsetup) | [Android](https://github.com/bitstadium/HockeySDK-Android#advancedsetup) +This will add the in-app update mechanism to your app. Detailed configuration options are in the advanced setup sections for each platform: [iOS](https://github.com/bitstadium/HockeySDK-iOS#advancedsetup) | [Android](https://github.com/bitstadium/HockeySDK-Android#advancedsetup) #### For iOS -The feature handles version updates, presents update and version information in a App Store like user interface, collects usage information and provides additional authorization options when using Ad-Hoc provisioning profiles. +The feature handles version updates, presents update and version information in an App Store like user interface, collects usage information and provides additional authorization options when using Ad-Hoc provisioning profiles. To enable automatic in-app updates you need to make sure to add `manager.Authenticator.AuthenticateInstallation();` after starting the SDK: -```C# +```csharp using HockeyApp.iOS; var manager = BITHockeyManager.SharedHockeyManager; -manager.Configure("Your_App_Id"); +manager.Configure("$Your_App_Id"); manager.StartManager(); manager.Authenticator.AuthenticateInstallation(); ``` -This module automatically disables itself when running in an App Store build by default! +**Please note:** This module automatically disables itself when running in an App Store build by default. -This feature can be disabled manually as follows: +If you manually want to disable the feature at some point, use this code: -```C# +```csharp using HockeyApp.iOS; var manager = BITHockeyManager.SharedHockeyManager; -manager.Configure("Your_App_Id"); +manager.Configure("$Your_App_Id"); manager.SetDisableUpdateManager = true; 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) +If you want to see beta analytics, use the beta distribution feature with in-app updates, restrict versions to specific users. Or if you want to know who is actually testing your app, 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). #### For Android -1. Open the activity where you want to inform the user about eventual updates. We'll assume you want to do this on startup of your main activity. -2. Add the following lines and make sure to always balance `register(...)` calls to SDK managers with `unregister()` calls in the corresponding lifecycle callbacks: -```C# +1. Open the activity where you want to inform the user about eventual updates. Typically you want to do this on startup of your main activity. +2. Add the following code and make sure to always balance `register(…)` calls to SDK managers with `unregister()` calls in the corresponding lifecycle callbacks: + +```csharp using HockeyApp.Android; namespace YourNameSpace { @@ -212,7 +226,7 @@ namespace YourNameSpace { private void CheckForUpdates() { // Remove this for store builds! - UpdateManager.Register(this, "Your_App_Id"); + UpdateManager.Register(this, "$Your_App_Id"); } private void UnregisterManagers() { @@ -232,20 +246,20 @@ namespace YourNameSpace { } ``` -When the activity is created, the update manager checks for new updates in the background. If it finds a new update, an alert dialog is shown and if the user presses Show, they will be taken to the update activity. The reason to only do this once upon creation is that the update check causes network traffic and therefore potential costs for your users. +When the activity is created, the update manager checks for new updates in the background. If it finds a new update, an alert dialog will be shown. If the user presses `Show` in said dialog, they will be taken to the update activity. The reason to only do this once upon creation is that the update check causes network traffic and therefore potential costs for your users. ### 2.6 Add in-app feedback -The feedback manager lets your users communicate directly with you via the app and an integrated user interface. It provides a single threaded discussion with a user running your app. Detailed configuration options are in advanced setup: [iOS](https://github.com/bitstadium/HockeySDK-iOS#advancedsetup) | [Android](https://github.com/bitstadium/HockeySDK-Android#advancedsetup) +The feedback manager lets your users communicate directly with you via the app and an integrated user interface. It provides a single threaded discussion with a user running your app. Detailed configuration options are in the advanced setup sections for each platform: [iOS](https://github.com/bitstadium/HockeySDK-iOS#advancedsetup) | [Android](https://github.com/bitstadium/HockeySDK-Android#advancedsetup) -1. You'll typically only want to show the feedback interface upon user interaction, for this example we assume you have a button `feedbackButton` in your view for this. -2. Add the following lines to your respective view controller/activity, handling the touch events and showing the feedback interface: +1. You'll typically only want to show the feedback interface upon user interaction, for this example, we assume you have a button `feedbackButton` in your view for this. +2. Add the following lines to your respective view controller/activity, handling the touch events and presenting the feedback interface: #### For iOS -You should never create your own instance of BITFeedbackManager but use the one provided by the `BITHockeyManager.sharedHockeyManager()`. +You should never create your own instance of `BITFeedbackManager` but use the one provided by the `BITHockeyManager.sharedHockeyManager()`. -```C# +```csharp using HockeyApp.iOS; namespace YourNameSpace { @@ -258,8 +272,8 @@ namespace YourNameSpace { public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { { // Initialise the Hockey SDK here - var manager = BITHockeyManager.SharedHockeyManager; - manager.Configure("Your_App_Id"); + var manager = BITHockeyManager.SharedHockeyManager; + manager.Configure("$Your_App_Id"); manager.StartManager(); // Create button and add action for click event @@ -287,7 +301,7 @@ Please check the [documentation](#documentation) of the `BITFeedbackManager` cla 1. You'll typically only want to show the feedback interface upon user interaction, for this example we assume you have a button `feedback_button` in your view for this. 2. Add the following lines to your respective activity, handling the touch events and showing the feedback interface: -```C# +```csharp using HockeyApp.Android; namespace YourNameSpace { @@ -297,22 +311,22 @@ namespace YourNameSpace { // Your own code to create the view // ... - FeedbackManager.Register(this, "Your-App-Id"); + FeedbackManager.Register(this, "$Your_App_Id"); Button feedbackButton = FindViewById