Skip to content

cancelAllLocalNotifications has been deprecated from iOS 10 #201

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

Closed
Dallas62 opened this issue Oct 20, 2020 · 5 comments · Fixed by #206
Closed

cancelAllLocalNotifications has been deprecated from iOS 10 #201

Dallas62 opened this issue Oct 20, 2020 · 5 comments · Fixed by #206
Assignees

Comments

@Dallas62
Copy link
Contributor

Hi,

This issue refer to: zo0r/react-native-push-notification#1716

The API of iOS "cancelAllLocalNotifications" has been deprecated from iOS 11, so it doesn't not work from iOS 11 or above.

Here the replacement method:
https://developer.apple.com/documentation/usernotifications/unusernotificationcenter/1649509-removeallpendingnotificationrequ

This is also probably the case for:
https://developer.apple.com/documentation/uikit/uiapplication?language=objc

  • scheduleLocalNotification:

    Schedules a local notification for delivery at its encapsulated date and time.
    Deprecated

  • presentLocalNotificationNow

    Presents a local notification immediately.
    Deprecated

  • cancelLocalNotification

    Cancels the delivery of the specified scheduled local notification.
    Deprecated

  • cancelAllLocalNotifications

    Cancels the delivery of all scheduled local notifications.
    Deprecated

  • scheduledLocalNotifications

    All currently scheduled local notifications.
    Deprecated

cc @Naturalclar

@Naturalclar
Copy link
Collaborator

@Dallas62 thanks for the information!
I'll add removeAllPendingNotificationRequests method for next version and deprecate cancelAllLocalNotifications method.

@Naturalclar
Copy link
Collaborator

I'll also work on other deprecated methods as well

@Naturalclar
Copy link
Collaborator

@Dallas62 I've added new methods that uses UNNotification instead of UILocalNotification in v1.7.0 🎉
I plan to remove the deprecated methods in the next major version of this repo.
There will be some modification needed in the https://github.com/zo0r/react-native-push-notification side, just fyi :)

@Dallas62
Copy link
Contributor Author

Thanks for this changes!
I will check that ASAP 😉

@YaoHuiJi
Copy link

YaoHuiJi commented Aug 7, 2021

Hi, @Dallas62 @Naturalclar thanks for your works. I have a question, when I build my app, I get warnings in file 'RNCPushNotificationIOS.h', is this ok?

'UILocalNotification' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationRequest

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

"@react-native-community/push-notification-ios": "^1.8.0"
"react-native-push-notification": "^7.4.0"

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 a pull request may close this issue.

3 participants