Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
freever committed Sep 13, 2024
1 parent c4e0627 commit 596cba4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Blauhaus.Push.Runner/Blauhaus.Push.Runner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blauhaus.Analytics.Console" Version="2.1.1" />
<PackageReference Include="Microsoft.Azure.NotificationHubs" Version="4.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
</ItemGroup>
Expand Down
16 changes: 16 additions & 0 deletions src/Blauhaus.Push.Runner/Config/MobileJackpotHub.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Blauhaus.Common.ValueObjects.RuntimePlatforms;

namespace Blauhaus.Push.Runner.Config;

public class MobileJackpotHub : BasePushRunnerHub
{
public MobileJackpotHub() : base(
platform: RuntimePlatform.Android,
pnsHandle: "d3qJ5-2cTM-sUG9NfZe-vx:APA91bHjU0niuFut_DwnY2sdFaYhJkdyUHsTR8VHjC9rqFg2UPgusOgWahH4WAbS-xtPXSxk8ImTjhaXOKTNaaVyfc3luqnaeqcRvAVq2MesBSGN8N9AxxlQetPGL-0GCbK7WyIXLfX0",
deviceId: "1bc0bb0585a648e4",
userId: "653")
{
NotificationHubConnectionString = "Endpoint=sb://mobile-jackpot-namespace.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=FgAFw3Mg1aEgTX8vItdZizTg/qXnO+JN6ajcbeIX7VA=";
NotificationHubName = "mobile-jackpot-notifications";
}
}
1 change: 1 addition & 0 deletions src/Blauhaus.Push.Runner/Config/Reveye/AspersHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ protected BaseAspersHub(IRuntimePlatform platform, string pnsHandle, string devi
"SharedAccessKey=mk4xOnfkwdbOAZ7CvAyAX0FwgOTm8TJFisEhj6hdhOE=";//";" +
//"EntityPath=reveye-push-aspers";


NotificationHubName = "reveye-push-aspers";
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/Blauhaus.Push.Runner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Blauhaus.Push.Server.Ioc;
using Microsoft.Azure.NotificationHubs;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace Blauhaus.Push.Runner
{
Expand All @@ -42,10 +43,10 @@ private static async Task Main(string[] args)
{
try
{
var hub = new LumenDevelopmentAndroidHub();
var hub = new MobileJackpotHub();
_pushNotificationsService = Setup(hub);
var reg = await GetAllRegistrationsAsync();

var registrationForUserDevice = await _pushNotificationsService.LoadRegistrationForUserDeviceAsync(hub.UserId, hub.DeviceId, hub);

if (registrationForUserDevice.IsSuccess && registrationForUserDevice.Value.Templates.Any())
Expand Down Expand Up @@ -77,9 +78,10 @@ await _pushNotificationsService.SendNotificationToUserDeviceAsync(
private static IPushNotificationsServerService Setup(BasePushRunnerHub hub)
{
var services = new ServiceCollection();

services.AddSingleton<IBuildConfig>(BuildConfig.Debug);
services.AddSingleton(typeof(IAnalyticsLogger<>), typeof(DummyLogger<>));
services.AddSingleton(typeof(ILogger<>), typeof(DummyLogger<>));


services.AddPushNotificationsServer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async Task<Response<IDeviceRegistration>> UpdateDeviceRegistrationAsync(I

await _hubClientProxy.CreateOrUpdateInstallationAsync(installation);

_logger.LogInformation("Push notification registration updated: {PushNotificationInstallation}", installation);
_logger.LogInformation("Push notification registration updated: {@PushNotificationInstallation}", installation);

return Response.Success(deviceRegistration);
}
Expand Down

0 comments on commit 596cba4

Please sign in to comment.