Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting badge count using UNUserNotificationCenter #1531

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

VladislavAntonyuk
Copy link
Collaborator

…on iOS 17 and above.

  • Added a conditional check to use UNUserNotificationCenter for setting the badge count if the iOS version is at least 17.
  • If the iOS version is below 17, continue to set the badge count using UIApplication.SharedApplication.ApplicationIconBadgeNumber.

This change ensures that the badge count can be set correctly on devices running iOS 17 and above, while maintaining compatibility with older versions of iOS.

Description of Change

Linked Issues

  • Fixes #

PR Checklist

  • Has a linked Issue, and the Issue has been approved(bug) or Championed (feature/proposal)
  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Documentation created or updated: https://github.com/MicrosoftDocs/CommunityToolkit/pulls

Additional information

…on iOS 17 and above.

- Added a conditional check to use `UNUserNotificationCenter` for setting the badge count if the iOS version is at least 17.
- If the iOS version is below 17, continue to set the badge count using `UIApplication.SharedApplication.ApplicationIconBadgeNumber`.

This change ensures that the badge count can be set correctly on devices running iOS 17 and above, while maintaining compatibility with older versions of iOS.
@VladislavAntonyuk VladislavAntonyuk requested a review from a team November 15, 2023 22:13
@VladislavAntonyuk VladislavAntonyuk self-assigned this Nov 15, 2023
@VladislavAntonyuk VladislavAntonyuk enabled auto-merge (squash) November 16, 2023 14:09
@VladislavAntonyuk VladislavAntonyuk merged commit dfe3022 into main Nov 16, 2023
8 checks passed
@VladislavAntonyuk VladislavAntonyuk deleted the badge-fix-obsolete-api branch November 16, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants