Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
freever committed Jan 26, 2024
1 parent 204d1a8 commit 77a0d27
Show file tree
Hide file tree
Showing 21 changed files with 117 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/blauhaus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
node ./scripts/getversion.js
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
dotnet-version: '8.x'
include-prerelease: true
- name: Install MAUI Workloads
run: |
Expand Down
16 changes: 8 additions & 8 deletions .pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pool:
variables:
solution: 'src\Blauhaus.Push.sln'
buildPlatform: 'Any CPU'
DotNetVersion: 7.x
DotNetVersion: 8.x
VersionName: $[replace(variables['Build.SourceBranchName'], 'refs/heads/release/', '')]
buildConfiguration: 'Release'
appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\'
Expand Down Expand Up @@ -63,14 +63,14 @@ steps:
targetType: 'inline'
script: |
dotnet publish ./src/Blauhaus.Push.Abstractions/Blauhaus.Push.Abstractions.csproj -f netstandard2.0 -c Release
dotnet publish ./src/Blauhaus.Push.Abstractions/Blauhaus.Push.Abstractions.csproj -f net7.0 -c Release
dotnet publish ./src/Blauhaus.Push.Abstractions/Blauhaus.Push.Abstractions.csproj -f net8.0 -c Release
dotnet publish ./src/Blauhaus.Push.Client/Blauhaus.Push.Client.csproj -f netstandard2.0 -c Release
dotnet publish ./src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj -f net7.0 -c Release
dotnet publish ./src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj -f net7.0-ios -c Release
dotnet publish ./src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj -f net7.0-android -c Release
dotnet publish ./src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj -f net7.0-windows10.0.19041 -c Release
dotnet publish ./src/Blauhaus.Push.Server/Blauhaus.Push.Server.csproj -f net7.0 -c Release
dotnet publish ./src/Blauhaus.Push.TestHelpers/Blauhaus.Push.TestHelpers.csproj -f net7.0 -c Release
dotnet publish ./src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj -f net8.0 -c Release
dotnet publish ./src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj -f net8.0-ios -c Release
dotnet publish ./src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj -f net8.0-android -c Release
dotnet publish ./src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj -f net8.0-windows10.0.19041 -c Release
dotnet publish ./src/Blauhaus.Push.Server/Blauhaus.Push.Server.csproj -f net8.0 -c Release
dotnet publish ./src/Blauhaus.Push.TestHelpers/Blauhaus.Push.TestHelpers.csproj -f net8.0 -c Release
- task: Bash@3
displayName: Pack
Expand Down
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,9 @@ Enter the server key in the Azure Notification Hub Google (GCM / FCM) section.

Install Xamarin.Firebase.Messaging and Blauhaus.Push.Client.Maui from nuget:

```xml
<!--Project references-->
<ItemGroup>
<ProjectReference Include="..\Lumen.Maui\Lumen.Maui.csproj" />
</ItemGroup>

```xml
<!--Android packages-->
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Firebase.Messaging">
<Version>123.1.2.2</Version>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blauhaus.Analytics.Abstractions" Version="2.0.10" />
<PackageReference Include="Blauhaus.Common.Abstractions" Version="2.3.18" />
<PackageReference Include="Blauhaus.Common.ValueObjects" Version="2.3.18" />
<PackageReference Include="Blauhaus.Analytics.Abstractions" Version="2.1.0" />
<PackageReference Include="Blauhaus.Common.Abstractions" Version="2.4.0" />
<PackageReference Include="Blauhaus.Common.ValueObjects" Version="2.4.0" />
</ItemGroup>

</Project>
30 changes: 20 additions & 10 deletions src/Blauhaus.Push.Client.Maui/Blauhaus.Push.Client.Maui.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041</TargetFrameworks>
<TargetFrameworks>net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ImplicitUsings>enable</ImplicitUsings>

<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net7.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net8.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net8.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net8.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-android')) != true">
<ItemGroup Condition="$(TargetFramework.StartsWith('net8.0-android')) != true">
<Compile Remove="**\Android\**\*.cs" />
<None Include="**\Android\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net7.0-ios')) != true AND $(TargetFramework.StartsWith('net7.0-maccatalyst')) != true">
<ItemGroup Condition="$(TargetFramework.StartsWith('net8.0-ios')) != true AND $(TargetFramework.StartsWith('net8.0-maccatalyst')) != true">
<Compile Remove="**\iOS\**\*.cs" />
<None Include="**\iOS\**\*.cs" Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder)" />
</ItemGroup>
Expand All @@ -46,7 +46,7 @@


<ItemGroup>
<PackageReference Include="Blauhaus.DeviceServices.Abstractions" Version="1.2.19" />
<PackageReference Include="Blauhaus.DeviceServices.Abstractions" Version="1.3.1" />
</ItemGroup>


Expand All @@ -55,15 +55,25 @@
</ItemGroup>


<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-android'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-android'">
<PackageReference Include="Xamarin.Azure.NotificationHubs.Android">
<Version>1.1.4.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.GooglePlayServices.Base">
<Version>118.2.0.2</Version>
<Version>118.2.0.5</Version>
</PackageReference>
</ItemGroup>


<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.6" />
</ItemGroup>


<ItemGroup>
<PackageReference Update="Microsoft.Maui.Controls.Compatibility" Version="8.0.6" />
</ItemGroup>



</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Blauhaus.DeviceServices.Abstractions" Version="1.2.19" />
<PackageReference Include="Blauhaus.Ioc.Abstractions" Version="1.5.4" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageReference Include="Blauhaus.DeviceServices.Abstractions" Version="1.3.1" />
<PackageReference Include="Blauhaus.Ioc.Abstractions" Version="1.6.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup>

Expand Down
14 changes: 7 additions & 7 deletions src/Blauhaus.Push.Client/Blauhaus.Push.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Blauhaus.Common.Configuration" Version="2.3.18" />
<PackageReference Include="Blauhaus.Common.Utils" Version="2.3.18" />
<PackageReference Include="Blauhaus.DeviceServices.Abstractions" Version="1.2.19" />
<PackageReference Include="Blauhaus.Ioc.Abstractions" Version="1.5.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="7.0.1" />
<PackageReference Include="Blauhaus.Common.Configuration" Version="2.4.0" />
<PackageReference Include="Blauhaus.Common.Utils" Version="2.4.0" />
<PackageReference Include="Blauhaus.DeviceServices.Abstractions" Version="1.3.1" />
<PackageReference Include="Blauhaus.Ioc.Abstractions" Version="1.6.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Blauhaus.Push.Runner/Blauhaus.Push.Runner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Azure.NotificationHubs" Version="4.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Blauhaus.Push.Server/Blauhaus.Push.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -13,8 +13,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Blauhaus.Analytics.Console" Version="2.0.10" />
<PackageReference Include="Blauhaus.Common.Utils" Version="2.3.18" />
<PackageReference Include="Blauhaus.Analytics.Console" Version="2.1.0" />
<PackageReference Include="Blauhaus.Common.Utils" Version="2.4.0" />
<PackageReference Include="Microsoft.Azure.NotificationHubs" Version="4.1.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blauhaus.Common.TestHelpers" Version="2.3.18" />
<PackageReference Include="Blauhaus.TestHelpers" Version="1.3.21" />
<PackageReference Include="Blauhaus.Common.TestHelpers" Version="2.4.0" />
<PackageReference Include="Blauhaus.TestHelpers" Version="1.4.4" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup>

Expand Down
12 changes: 6 additions & 6 deletions src/Blauhaus.Push.Tests.Server/Blauhaus.Push.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blauhaus.Analytics.TestHelpers" Version="2.0.10" />
<PackageReference Include="Blauhaus.DeviceServices.TestHelpers" Version="1.2.19" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="Blauhaus.Analytics.TestHelpers" Version="2.1.0" />
<PackageReference Include="Blauhaus.DeviceServices.TestHelpers" Version="1.3.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="nunit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public async Task SHOULD_parse_and_publish_Async_Notification()
var result = await PushNotificationAwaiter.Task;

//Assert
Assert.AreEqual("This is the Message", result.DataProperties["message"]);
Assert.AreEqual("Win!", result.DataProperties["exclusive"]);
Assert.AreEqual(1, result.DataProperties["integer"]);
Assert.AreEqual("DefaultTitle", result.Title);
Assert.AreEqual("DefaultBody", result.Body);
Assert.AreEqual("My Template Name", result.Name);
Assert.That(result.DataProperties["message"], Is.EqualTo("This is the Message"));
Assert.That(result.DataProperties["exclusive"], Is.EqualTo("Win!"));
Assert.That(result.DataProperties["integer"], Is.EqualTo(1));
Assert.That(result.Title, Is.EqualTo("DefaultTitle"));
Assert.That(result.Body, Is.EqualTo("DefaultBody"));
Assert.That(result.Name, Is.EqualTo("My Template Name"));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task SHOULD_load_and_return_handle_from_secure_storage()
var result = await Sut.GetPushNotificationServiceHandleAsync();

//Assert
Assert.AreEqual("stored handle", result);
Assert.That(result, Is.EqualTo("stored handle"));
}

[Test]
Expand All @@ -36,7 +36,7 @@ public async Task IF_no_stored_handle_exists_SHOULD_return_empty_string_and_trac
var result = await Sut.GetPushNotificationServiceHandleAsync();

//Assert
Assert.AreEqual(string.Empty, result);
Assert.That(result, Is.EqualTo(string.Empty));
}

[Test]
Expand All @@ -47,8 +47,8 @@ public async Task SHOULD_cache_loaded_value()
var result2 = await Sut.GetPushNotificationServiceHandleAsync();

//Assert
Assert.AreEqual("stored handle", result1);
Assert.AreEqual("stored handle", result2);
Assert.That(result1, Is.EqualTo("stored handle"));
Assert.That(result2, Is.EqualTo("stored handle"));
MockSecureStorageService.Mock.Verify(x => x.GetAsync("PnsHandle"), Times.Once);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task IF_value_is_different_than_previous_one_SHOULD_update_cached_v
//Assert
var result = await Sut.GetPushNotificationServiceHandleAsync();
MockSecureStorageService.Mock.Verify(x => x.GetAsync("PnsHandle"), Times.Never);
Assert.AreEqual("even newer Handle", result);
Assert.That(result, Is.EqualTo("even newer Handle"));
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public async Task SHOULD_parse_and_publish_Async_Update()
var result = await PushNotificationAwaiter.Task;

//Assert
Assert.AreEqual("This is the Message", result.DataProperties["message"]);
Assert.AreEqual("Win!", result.DataProperties["exclusive"]);
Assert.AreEqual(1, result.DataProperties["integer"]);
Assert.AreEqual("DefaultTitle", result.Title);
Assert.AreEqual("DefaultBody", result.Body);
Assert.AreEqual("My Template", result.Name);
Assert.That(result.DataProperties["message"], Is.EqualTo("This is the Message"));
Assert.That(result.DataProperties["exclusive"], Is.EqualTo("Win!"));
Assert.That(result.DataProperties["integer"], Is.EqualTo(1));
Assert.That(result.Title, Is.EqualTo("DefaultTitle"));
Assert.That(result.Body, Is.EqualTo("DefaultBody"));
Assert.That(result.Name, Is.EqualTo("My Template"));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public async Task SHOULD_parse_DataProperties_and_publish_AsyncPublisher_update(
var result = await PushNotificationAwaiter.Task;

//Assert
Assert.AreEqual("DefaultTitle", result.Title);
Assert.AreEqual("DefaultBody", result.Body);
Assert.AreEqual("My Template", result.Name);
Assert.AreEqual("This is the Message", result.DataProperties["message"]);
Assert.AreEqual("Win!", result.DataProperties["exclusive"]);
Assert.AreEqual(1, result.DataProperties["integer"]);
Assert.AreEqual(3, result.DataProperties.Count);
Assert.That(result.Title, Is.EqualTo("DefaultTitle"));
Assert.That(result.Body, Is.EqualTo("DefaultBody"));
Assert.That(result.Name, Is.EqualTo("My Template"));
Assert.That(result.DataProperties["message"], Is.EqualTo("This is the Message"));
Assert.That(result.DataProperties["exclusive"], Is.EqualTo("Win!"));
Assert.That(result.DataProperties["integer"], Is.EqualTo(1));
Assert.That(result.DataProperties.Count, Is.EqualTo(3));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void SHOULD_extract_UWP_notification()
var result = Sut.ExtractNotification(RuntimePlatform.UWP, _pushNotification);

//Assert
Assert.AreEqual(expectedPayload, result.Value.Notification.Body);
Assert.That(result.Value.Notification.Body, Is.EqualTo(expectedPayload));
}

[Test]
Expand All @@ -71,7 +71,7 @@ public void SHOULD_extract_Ios_notification()
var result = Sut.ExtractNotification(RuntimePlatform.iOS, _pushNotification);

//Assert
Assert.AreEqual(expectedPayload, result.Value.Notification.Body);
Assert.That(result.Value.Notification.Body, Is.EqualTo(expectedPayload));
}

[Test]
Expand All @@ -95,7 +95,7 @@ public void SHOULD_extract_Android_notification()
var result = Sut.ExtractNotification(RuntimePlatform.Android, _pushNotification);

//Assert
Assert.AreEqual(expectedPayload, result.Value.Notification.Body);
Assert.That(result.Value.Notification.Body, Is.EqualTo(expectedPayload));
}
}
}
Loading

0 comments on commit 77a0d27

Please sign in to comment.