From 4732865ce948e2fb4c85e9cefc615f5aa5445ee3 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 25 Jan 2023 16:42:02 +0100 Subject: [PATCH 1/3] changed notification query parameter from Token to deviceIdentifier --- .../NotifoMobilePush/NotifoMobilePushImplementation.ios.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs b/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs index 8ca7a6d..b078a16 100644 --- a/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs +++ b/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs @@ -155,7 +155,7 @@ private async Task> GetPendingNotifications1_0Async(in private async Task> GetPendingNotifications1_4Async(int take, DateTime after, CancellationToken ct) { - var result = await Client.Notifications.GetMyDeviceNotificationsAsync(token, after, true, take * 2, ct); + var result = await Client.Notifications.GetMyDeviceNotificationsAsync(DeviceIdentifier, after, true, take, ct); return result.Items; } From 6ba226ff5172f23e01f6c3f90833238d3cdce2d1 Mon Sep 17 00:00:00 2001 From: CR4567 Date: Wed, 25 Jan 2023 21:35:03 +0100 Subject: [PATCH 2/3] increase the amount of pending notifications again --- .../NotifoMobilePush/NotifoMobilePushImplementation.ios.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs b/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs index b078a16..d3d96d3 100644 --- a/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs +++ b/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs @@ -155,7 +155,7 @@ private async Task> GetPendingNotifications1_0Async(in private async Task> GetPendingNotifications1_4Async(int take, DateTime after, CancellationToken ct) { - var result = await Client.Notifications.GetMyDeviceNotificationsAsync(DeviceIdentifier, after, true, take, ct); + var result = await Client.Notifications.GetMyDeviceNotificationsAsync(DeviceIdentifier, after, true, take * 2, ct); return result.Items; } @@ -416,4 +416,4 @@ public void DidReceiveNotificationResponse(UNNotificationResponse response) } } } -} \ No newline at end of file +} From dee5c880c9bf309cb67f6cbd04747aa76c259dbd Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 26 Jan 2023 10:19:50 +0100 Subject: [PATCH 3/3] add comment --- Directory.Build.props | 2 +- .../NotifoMobilePush/NotifoMobilePushImplementation.ios.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index ae3d33e..783faff 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ MIT https://notifo.io notifo xamarin firebase - 1.2.1-beta1 + 1.2.1-beta2 9 diff --git a/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs b/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs index d3d96d3..c794f28 100644 --- a/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs +++ b/sdk/Notifo.SDK.Core/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs @@ -155,6 +155,8 @@ private async Task> GetPendingNotifications1_0Async(in private async Task> GetPendingNotifications1_4Async(int take, DateTime after, CancellationToken ct) { + // use DeviceIdentifier because Token could change over time and you could miss pending notifications. DeviceIdentifier should be more stable. + // take is not returning the exact amount of entries. It's taking the X last entries, then filters for messages that are unseen. var result = await Client.Notifications.GetMyDeviceNotificationsAsync(DeviceIdentifier, after, true, take * 2, ct); return result.Items;