g123k / flutter_app_badger

Support to update the app badge on the launcher (both for Android and iOS)
https://pub.dev/packages/flutter_app_badger
Apache License 2.0
307 stars 172 forks source link

'currentUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 #93

Open SarahGhorbani opened 10 months ago

SarahGhorbani commented 10 months ago

Hello, I get these 6 errors in your package in the ios section:

1- 'currentUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] and -[UNUserNotificationCenter getNotificationCategoriesWithCompletionHandler:]

2- 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings

3- 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings

4- 'UIUserNotificationTypeAlert' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions

5- 'UIUserNotificationTypeBadge' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions

6- 'UIUserNotificationTypeSound' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions

I used IOS 17. Do you have any solution or update?

kirkmorrow commented 4 months ago

Looking at the code there is already a conditional to handle this as shown below. I also see these but only as warnings in Xcode but not errors.

    if (@available(iOS 10, *)) {
        UNUserNotificationCenter *center = [UNUserNotificationCenter
...
    } else {
        UIUserNotificationSettings* notificationSettings =