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

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaswenz committed Sep 16, 2016
2 parents 1a1d07c + 36dec89 commit 6833439
Show file tree
Hide file tree
Showing 14 changed files with 213 additions and 94 deletions.
10 changes: 5 additions & 5 deletions HockeySDK.nuspec
Expand Up @@ -18,15 +18,15 @@
<files>

<!-- Core -->
<file src="./source/HockeySDK/bin/Release/HockeySDK.dll" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\HockeySDK.dll" />
<file src="./source/HockeySDK/bin/Release/HockeySDK.dll" target="lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/HockeySDK.dll" />

<!-- Android -->
<file src="./source/HockeySDK.Android/bin/Release/HockeySDK.dll" target="lib\MonoAndroid403\HockeySDK.dll" />
<file src="./source/HockeySDK.AndroidBindings/bin/Release/HockeySDK.AndroidBindings.dll" target="lib\MonoAndroid403\HockeySDK.AndroidBindings.dll" />
<file src="./source/HockeySDK.Android/bin/Release/HockeySDK.dll" target="lib/MonoAndroid403/HockeySDK.dll" />
<file src="./source/HockeySDK.AndroidBindings/bin/Release/HockeySDK.AndroidBindings.dll" target="lib/MonoAndroid403/HockeySDK.AndroidBindings.dll" />

<!-- iOS -->
<file src="./source/HockeySDK.iOS/bin/Release/HockeySDK.dll" target="lib\Xamarin.iOS10\HockeySDK.dll" />
<file src="./source/HockeySDK.iOSBindings/bin/full/Release/HockeySDK.iOSBindings.dll" target="lib\Xamarin.iOS10\HockeySDK.iOSBindings.dll" />
<file src="./source/HockeySDK.iOS/bin/Release/HockeySDK.dll" target="lib/Xamarin.iOS10/HockeySDK.dll" />
<file src="./source/HockeySDK.iOSBindings/bin/full/Release/HockeySDK.iOSBindings.dll" target="lib/Xamarin.iOS10/HockeySDK.iOSBindings.dll" />

</files>
</package>
196 changes: 121 additions & 75 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bootstrapper.sh 100644 → 100755
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions build.cake
Expand Up @@ -2,11 +2,11 @@
#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";

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.1.zip";

var SAMPLES = new [] {
"./samples/HockeyAppSampleAndroid.sln",
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/HockeySDK.embeddedframework/HockeySDK.framework/Versions/A/HockeySDK", "./externals/ios/libHockeySDK.a");
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");
CopyDirectory ("./externals/ios/HockeySDK-iOS/HockeySDK.embeddedframework/HockeySDK.framework/Versions/A/Resources/HockeySDKResources.bundle", "./externals/ios/HockeySDKResources.bundle");
CopyDirectory ("./externals/ios/HockeySDK-iOS/HockeySDKAllFeatures/HockeySDK.embeddedframework/HockeySDK.framework/Versions/A/Resources/HockeySDKResources.bundle", "./externals/ios/HockeySDKResources.bundle");
});

// Create a common externals task depending on platform specific ones
Expand Down
6 changes: 3 additions & 3 deletions component/forms/GettingStarted.md
Expand Up @@ -8,7 +8,7 @@ Configuration and Initialization must be done in platform specific projects usin
You can check if a crash occured in the last session by adding the following lines:

```csharp
using HockeySDK;
using HockeyApp;
```

```csharp
Expand All @@ -20,7 +20,7 @@ CrashManager.DidCrashCrashInLastSession;
You can enable/disable the MetricsManager and track custom events using the following lines:

```csharp
using HockeySDK;
using HockeyApp;
```

```csharp
Expand All @@ -41,7 +41,7 @@ This will add crash reporting capabilities to your app.
Open your AppDelegate.cs file, and add the following lines:

```csharp
using HockeySDK.iOS;
using HockeyApp.iOS;

namespace YourNameSpace
{
Expand Down
2 changes: 1 addition & 1 deletion component/ios.crashonly/GettingStarted.md
Expand Up @@ -9,7 +9,7 @@ This will add crash reporting capabilities to your app.
Open your AppDelegate.cs file, and add the following lines:

```csharp
using HockeySDK.iOS;
using HockeyApp.iOS;

namespace YourNameSpace
{
Expand Down
2 changes: 1 addition & 1 deletion component/ios/GettingStarted.md
Expand Up @@ -9,7 +9,7 @@ This will add crash reporting capabilities to your app.
Open your AppDelegate.cs file, and add the following lines:

```csharp
using HockeySDK.iOS;
using HockeyApp.iOS;

namespace YourNameSpace
{
Expand Down
17 changes: 17 additions & 0 deletions source/HockeySDK.Android/PlatformMetricsManager.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using HockeyMetrics = HockeyApp.Android.Metrics;

namespace HockeyApp
Expand Down Expand Up @@ -52,6 +53,22 @@ public void TrackEvent(string eventName)
{
HockeyMetrics.MetricsManager.TrackEvent(eventName);
}

public void TrackEvent(string eventName, Dictionary<string, string> properties, Dictionary<string, double> measurements)
{
Dictionary<string, Java.Lang.Double> measurementsHelper = null;
if (measurements != null)
{
measurementsHelper = new Dictionary<string, Java.Lang.Double>();
foreach (KeyValuePair<string, double> pair in measurements)
{
measurementsHelper.Add(pair.Key, new Java.Lang.Double(pair.Value));
}
}

HockeyMetrics.MetricsManager.TrackEvent(eventName, properties, measurementsHelper);
}

}
}

4 changes: 2 additions & 2 deletions source/HockeySDK.Build/HockeySDK.Build.csproj
Expand Up @@ -17,7 +17,7 @@
<CustomCommands>
<Command type="Build" command="sh ./bootstrapper.sh -t nuget" workingdir="${ProjectDir}/../.." />
<Command type="Clean" command="sh ./bootstrapper.sh -t clean" workingdir="${ProjectDir}/../.." />
<Command type="Execute" />
<Command type="Execute" command="" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
Expand All @@ -29,7 +29,7 @@
<CustomCommands>
<Command type="Build" command="sh ./bootstrapper.sh -t components" workingdir="${ProjectDir}/../.." />
<Command type="Clean" command="sh ./bootstrapper.sh -t clean" workingdir="${ProjectDir}/../.." />
<Command type="Execute" />
<Command type="Execute" command="" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
Expand Down
3 changes: 3 additions & 0 deletions source/HockeySDK.Shared/Interfaces/IPlatformMetricsManager.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;

namespace HockeyApp
{
Expand All @@ -7,6 +8,8 @@ internal interface IPlatformMetricsManager
bool Disabled { get; set; }

void TrackEvent(string eventName);

void TrackEvent(string eventName, Dictionary<string, string> properties, Dictionary<string, double> measurements);
}
}

12 changes: 12 additions & 0 deletions source/HockeySDK.Shared/MetricsManager.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;

namespace HockeyApp
{
Expand Down Expand Up @@ -34,6 +35,17 @@ public static void TrackEvent(string eventName)
{
PlatformMetricsManager.TrackEvent(eventName);
}

/// <summary>
/// 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.
/// </summary>
/// <param name="eventName">The event’s name as a string.</param>
/// <param name="properties">A dictionary of properties to attach to the event.</param>
/// <param name="measurements">A dictionary of measurements to attach to the event.</param>
public static void TrackEvent(string eventName, Dictionary<string, string> properties, Dictionary<string, double> measurements)
{
PlatformMetricsManager.TrackEvent(eventName, properties, measurements);
}
}
}

31 changes: 31 additions & 0 deletions source/HockeySDK.iOS/PlatformMetricsManager.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
using HockeyApp.iOS;
using Foundation;

namespace HockeyApp
{
Expand All @@ -17,6 +19,35 @@ public void TrackEvent(string eventName)
{
BITHockeyManager.SharedHockeyManager.MetricsManager.TrackEvent(eventName);
}

public void TrackEvent(string eventName, Dictionary<string, string> properties, Dictionary<string, double> measurements)
{
NSMutableDictionary propertiesHelper = null;
if (properties != null)
{
propertiesHelper = new NSMutableDictionary();
foreach (KeyValuePair<string, string> pair in properties)
{
propertiesHelper.Add(NSString.FromObject(pair.Key), NSString.FromObject(pair.Value));
}
}

NSMutableDictionary measurementsHelper = null;
if (measurements != null)
{
measurementsHelper = new NSMutableDictionary();
foreach (KeyValuePair<string, double> pair in measurements)
{
measurementsHelper.Add(NSString.FromObject(pair.Key), NSNumber.FromDouble(pair.Value));
}
}

BITHockeyManager.SharedHockeyManager.MetricsManager.TrackEvent(eventName,
propertiesHelper,
measurementsHelper);
}


}
}

4 changes: 4 additions & 0 deletions source/HockeySDK.iOSBindings/ApiDefinition.cs
Expand Up @@ -259,6 +259,10 @@ public partial interface BITMetricsManager
[Export ("trackEventWithName:")]
void TrackEvent (string eventName);

// - (void)trackEventWithName:(nonnull NSString *)eventName properties:(nullable NSDictionary<NSString *, NSString *> *)properties measurements:(nullable NSDictionary<NSString *, NSNumber *> *)measurements;
[Export("trackEventWithName:properties:measurements:")]
void TrackEvent(string eventName, [NullAllowed] NSDictionary properties, [NullAllowed] NSDictionary measurements);

[Export ("serverURL", ArgumentSemantic.Retain)]
string ServerURL { get; set; }
}
Expand Down
6 changes: 6 additions & 0 deletions source/HockeySDK/PlatformMetricsManager.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;

namespace HockeyApp
{
Expand All @@ -16,6 +17,11 @@ public void TrackEvent(string eventName)
{
throw new NotImplementedException(PCL.BaitWithoutSwitchMessage);
}

public void TrackEvent(string eventName, Dictionary<string, string> properties, Dictionary<string, double> measurements)
{
throw new NotImplementedException(PCL.BaitWithoutSwitchMessage);
}
}
}

0 comments on commit 6833439

Please sign in to comment.