0

In handleActionWithIdentifier:forLocalNotification:'s docs, this method is declared that deprecated from WatchOS 2.0

I looked for App Programming Guide for watchOS, at Notification section, they suggest using UNUserNotificationCenter of UserNotifications framework. But this framework does require WatchOS >= 3.0

How do my app adapt to WatchOS 2.0 user?

Sang
  • 4,049
  • 3
  • 37
  • 47

1 Answers1

0

For WatchOS 2.0 you have to implement the deprecated method handleActionWithIdentifier:forLocalNotification:. The method has been deprecated with the introduction of the UserNotifications framework. As this framework is not available on WatchOS before 3.0, the deprecated method is the way to go for older versions.

naglerrr
  • 2,809
  • 1
  • 12
  • 24
  • they do show this method deprecated from watch os 2.0, not 3.0. I may check different version of the method, could you provide a link? – Sang Feb 17 '17 at 13:16
  • No they do not. The documentation states that the methods is available from 2.0 to 3.0. The "to"-version is when the method was deprecated. Check `- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated;` for example: The documentation shows its available from 2.0 to 9.0. It was deprecated in 9.0. https://developer.apple.com/reference/uikit/uiapplication/1622923-setstatusbarstyle – naglerrr Feb 17 '17 at 13:28
  • You can also take a look at the NS_DEPRECATED_IOS Macro used to deprecate methods as a reference. "The NS_DEPRECATED_IOS(2_0, 6_0) macro has two version numbers. The first number is when the method was introduced, and the second is when it was deprecated." http://iosdevelopertips.com/best-practices/eveything-you-need-to-know-about-ios-and-os-x-deprecated-apis.html – naglerrr Feb 17 '17 at 13:33