-
Notifications
You must be signed in to change notification settings - Fork 24
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
[iOS10] UILocalNotification is deprecated from iOS10 and up #19
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so long! I missed this originally.
I'm a bit confused by the duplicate #if/#elif
lines: what's the logic there?
Alternatively I'm also thinking: this could use some clean up, and use NS_AVAILABLE
declarations and @available instead.
@@ -107,7 +108,8 @@ NS_ASSUME_NONNULL_BEGIN | |||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler; | |||
#endif | |||
|
|||
#if JSIOS8SDK | |||
#if JSIOS10SDK | |||
#elif JSIOS8SDK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm why these 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JaviSoto So didRegisterUserNotifications
and handleActionWithIdentifier
were both added in iOS8 but deprecated in iOS10.
and #if JSIOS8SDK
condition is true for all iOS versions 8 and above. Hence I added an if for iOS10> where those methods are not registered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, should this be #if JSIOS8SDK && ! JSIOS10SDK
perhaps to make it more clear?
I think the JSIOXSDK
macros should be renamed to like JSSDKAtLeastIOS9
. That way this would be a bit clearer.
Alternatively, what I would like is to stop using those macros, and instead, add:
NS_DEPRECATED_IOS(8_0, 10_0)
What do you think?
I am not sure if you can provide a min and max iOS version for NS_AVAILABLE_IOS. Though I have renamed the macros to something that's way more readable. Let me know how that looks. |
Yeah, look at NS_DEPRECATED_IOS(INTRODUCED, DEPRECATED)
// E.g.:
NS_DEPRECATED_IOS(2_0, 10_0) |
Upgraded our project to minimum iOS10. Fixed all the warnings