Skip to content

Commit

Permalink
Merge pull request #22 from notifo-io/bugfix/optimizedPendingNotifica…
Browse files Browse the repository at this point in the history
…tions

Optimized PendingNotification Query
  • Loading branch information
CR4567 authored Jan 26, 2023
2 parents 380b1ea + dee5c88 commit 84693db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://notifo.io</PackageProjectUrl>
<PackageTags>notifo xamarin firebase</PackageTags>
<Version>1.2.1-beta1</Version>
<Version>1.2.1-beta2</Version>
<LangVersion>9</LangVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ private async Task<List<UserNotificationDto>> GetPendingNotifications1_0Async(in
private async Task<List<UserNotificationDto>> GetPendingNotifications1_4Async(int take, DateTime after,
CancellationToken ct)
{
var result = await Client.Notifications.GetMyDeviceNotificationsAsync(token, after, true, take * 2, 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;
}
Expand Down Expand Up @@ -416,4 +418,4 @@ public void DidReceiveNotificationResponse(UNNotificationResponse response)
}
}
}
}
}

0 comments on commit 84693db

Please sign in to comment.