Skip to content

Commit 5054b4c

Browse files
Improvements to tracking.
1 parent 72f0ace commit 5054b4c

17 files changed

+231
-90
lines changed

sample/Sample.iOS.Shared/Sample.iOS.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</ProjectReference>
5151
</ItemGroup>
5252
<ItemGroup>
53-
<PackageReference Include="Notifo.SDK" Version="1.3.0" />
53+
<PackageReference Include="Notifo.SDK" Version="1.5.1" />
5454
</ItemGroup>
5555
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
5656
</Project>

sample/Sample.iOS/Application.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8-
using Foundation;
98
using UIKit;
109

1110
#pragma warning disable SA1300 // Element should begin with upper-case letter

sample/SampleNotificationServiceExtension/SampleNotificationServiceExtension.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
9191
<HintPath>..\..\packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
9292
</Reference>
93-
<Reference Include="Notifo.SDK, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
94-
<HintPath>..\..\packages\Notifo.SDK.1.3.0\lib\netstandard2.1\Notifo.SDK.dll</HintPath>
93+
<Reference Include="Notifo.SDK, Version=1.5.1.0, Culture=neutral, processorArchitecture=MSIL">
94+
<HintPath>..\..\packages\Notifo.SDK.1.5.1\lib\netstandard2.1\Notifo.SDK.dll</HintPath>
9595
</Reference>
9696
<Reference Include="System" />
9797
<Reference Include="System.Xml" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="xamarinios10" />
4-
<package id="Notifo.SDK" version="1.3.0" targetFramework="xamarinios10" />
4+
<package id="Notifo.SDK" version="1.5.1" targetFramework="xamarinios10" />
55
<package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="xamarinios10" />
66
</packages>

sdk/Notifo.SDK.FirebasePlugin/Notifo.SDK.FirebasePlugin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
</ItemGroup>
5454

5555
<ItemGroup>
56-
<PackageReference Include="Notifo.SDK" Version="1.3.0" />
56+
<PackageReference Include="Notifo.SDK" Version="1.5.1" />
5757
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="5.0.0" />
5858
</ItemGroup>
5959

sdk/Notifo.SDK.FirebasePlugin/NotifoMobilePushExtensions.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ public static class NotifoMobilePushExtensions
2323
/// <summary>
2424
/// Use the firebase plugin as the push events provider.
2525
/// </summary>
26-
/// <param name="notifoMobilePush">
27-
/// The <see cref="INotifoMobilePush"/> instance.
28-
/// </param>
26+
/// <param name="notifoMobilePush">The <see cref="INotifoMobilePush"/> instance.</param>
2927
/// <returns>The current instance.</returns>
3028
public static INotifoMobilePush UseFirebasePluginEventsProvider(this INotifoMobilePush notifoMobilePush)
3129
{

sdk/Notifo.SDK/ApiVersion.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ==========================================================================
2+
// Notifo.io
3+
// ==========================================================================
4+
// Copyright (c) Sebastian Stehle
5+
// All rights reserved. Licensed under the MIT license.
6+
// ==========================================================================
7+
8+
namespace Notifo.SDK
9+
{
10+
/// <summary>
11+
/// The target version.
12+
/// </summary>
13+
public enum ApiVersion
14+
{
15+
/// <summary>
16+
/// Uses only old API versions.
17+
/// </summary>
18+
Version_1_0,
19+
20+
/// <summary>
21+
/// Uses also APIs that are only available after 1.5.
22+
/// </summary>
23+
Version_1_5
24+
}
25+
}

sdk/Notifo.SDK/Constants.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ internal static class Constants
4747

4848
public const string SubjectKey = "subject";
4949

50-
public const string TrackingUrlKey = "trackingUrl";
50+
public const string TrackingTokenKey = "trackingToken";
51+
52+
public const string TrackSeenUrlKey = "trackingUrl";
5153
}
5254
}

sdk/Notifo.SDK/Extensions/UserNotificationDtoExtensions.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,14 @@ public static Dictionary<string, string> ToDictionary(this UserNotificationDto n
6363

6464
data[Constants.SilentKey] = notification.Silent.ToString();
6565

66+
if (!string.IsNullOrWhiteSpace(notification.TrackingToken))
67+
{
68+
data[Constants.TrackingTokenKey] = notification.TrackingToken;
69+
}
70+
6671
if (!string.IsNullOrWhiteSpace(notification.TrackSeenUrl))
6772
{
68-
data[Constants.TrackingUrlKey] = notification.TrackSeenUrl;
73+
data[Constants.TrackSeenUrlKey] = notification.TrackSeenUrl;
6974
}
7075

7176
if (!string.IsNullOrWhiteSpace(notification.Data))
@@ -141,7 +146,12 @@ public static UserNotificationDto FromDictionary(this UserNotificationDto notifi
141146
notification.Silent = Convert.ToBoolean(silent.ToString());
142147
}
143148

144-
if (data.TryGetValue(Constants.TrackingUrlKey, out var trackingUrl))
149+
if (data.TryGetValue(Constants.TrackingTokenKey, out var trackingToken))
150+
{
151+
notification.TrackingToken = trackingToken.ToString();
152+
}
153+
154+
if (data.TryGetValue(Constants.TrackSeenUrlKey, out var trackingUrl))
145155
{
146156
notification.TrackSeenUrl = trackingUrl.ToString();
147157
}

sdk/Notifo.SDK/INotifoMobilePush.cs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,37 @@ public partial interface INotifoMobilePush : INotifoClient
3131
event EventHandler<NotificationErrorEventArgs> OnError;
3232

3333
/// <summary>
34-
/// Sets the api key to use.
34+
/// The used API version.
35+
/// </summary>
36+
ApiVersion ApiVersion { get; }
37+
38+
/// <summary>
39+
/// Sets the API key to use.
3540
/// </summary>
3641
/// <param name="apiKey">
37-
/// The api key.
42+
/// The API key.
3843
/// </param>
3944
/// <returns>The current instance.</returns>
4045
INotifoMobilePush SetApiKey(string apiKey);
4146

47+
/// <summary>
48+
/// Sets the API version to use.
49+
/// </summary>
50+
/// <param name="apiVersion">The API version.</param>
51+
/// <returns>The current instance.</returns>
52+
INotifoMobilePush SetApiVersion(ApiVersion apiVersion);
53+
4254
/// <summary>
4355
/// Sets the api URL to use.
4456
/// </summary>
45-
/// <param name="baseUrl">
46-
/// The api URL. Default: https://app.notifo.io.
47-
/// </param>
57+
/// <param name="baseUrl">The api URL. Default: https://app.notifo.io.</param>
4858
/// <returns>The current instance.</returns>
4959
INotifoMobilePush SetBaseUrl(string baseUrl);
5060

5161
/// <summary>
5262
/// Sets the push events provider.
5363
/// </summary>
54-
/// <param name="pushEventsProvider">
55-
/// The <see cref="IPushEventsProvider"/> implementation.
56-
/// </param>
64+
/// <param name="pushEventsProvider">The <see cref="IPushEventsProvider"/> implementation. </param>
5765
/// <returns>The current instance.</returns>
5866
INotifoMobilePush SetPushEventsProvider(IPushEventsProvider pushEventsProvider);
5967

0 commit comments

Comments
 (0)