-
Notifications
You must be signed in to change notification settings - Fork 277
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
'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 #14
Comments
Yeah that would be VERY helpful. And can you (i could help) adding more support for repeat (f.e. daysOfWeek, ...). Thank you! |
Does somebody know what RCTSharedApplication() is and for what im using it for? |
RNPushNotificationIOS.m file `/**
#import "RNCPushNotificationIOS.h" #import <UserNotifications/UserNotifications.h> #import <React/RCTBridge.h> NSString *const RCTRemoteNotificationReceived = @"RemoteNotificationReceived"; static NSString *const kLocalNotificationReceived = @"LocalNotificationReceived"; static NSString *const kErrorUnableToRequestPermissions = @"E_UNABLE_TO_REQUEST_PERMISSIONS"; #if !TARGET_OS_TV RCT_ENUM_CONVERTER(NSCalendarUnit, @interface RNCPushNotificationIOS () @implementation RCTConvert (UNNotificationRequest)
RCT_ENUM_CONVERTER(UIBackgroundFetchResult, (@{ @EnD @implementation RNCPushNotificationIOS #if !TARGET_OS_TV static NSDictionary *RCTFormatUNNotification(UNNotification *notification) formattedNotification[@"identifier"] = notification.request.identifier; if (notification.date) { formattedNotification[@"title"] = RCTNullIfNil(content.title); return formattedNotification; #endif //TARGET_OS_TV RCT_EXPORT_MODULE()
#if !TARGET_OS_TV
//+ (void)didReceiveLocalNotification:(UNNotificationRequest *)notification
//- (void)handleRegisterUserNotificationSettings:(NSNotification *)notification RCT_EXPORT_METHOD(onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result) { /**
/**
RCT_EXPORT_METHOD(requestPermissions:(NSDictionary *)permissions if (_requestPermissionsResolveBlock != nil) { // Add a listener to make sure that startObserving has been called UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; UNAuthorizationOptions options = UNAuthorizationOptionAlert + UNAuthorizationOptionSound + UNAuthorizationOptionBadge; RCT_EXPORT_METHOD(abandonPermissions) RCT_EXPORT_METHOD(checkPermissions:(RCTResponseSenderBlock)callback) //RCT_EXPORT_METHOD(presentLocalNotification:(UNNotificationRequest *)notification) RCT_EXPORT_METHOD(scheduleLocalNotification:(UNNotificationRequest *)notification) RCT_EXPORT_METHOD(cancelAllLocalNotifications) RCT_EXPORT_METHOD(cancelLocalNotifications:(NSArray<NSString *> *)identifiers) //RCT_EXPORT_METHOD(getInitialNotification:(RCTPromiseResolveBlock)resolve //RCT_EXPORT_METHOD(getScheduledLocalNotifications:(RCTResponseSenderBlock)callback) RCT_EXPORT_METHOD(removeAllDeliveredNotifications) RCT_EXPORT_METHOD(removeDeliveredNotifications:(NSArray<NSString *> *)identifiers) RCT_EXPORT_METHOD(getDeliveredNotifications:(RCTResponseSenderBlock)callback)
} #else //TARGET_OS_TV
#endif //TARGET_OS_TV @EnD First changes i have made. Not tested at all (just that app still starts). And i have just commented some methods. Any help is welcome! |
Is this also related to methods such as I see that method used within RNCPushNotificationIOS.m, but is apparently labeled deprecated in the link above? |
#66 went a long way toward doing this, I think! I'd suggest a few followups to that: It's no longer necessary for people to override the deprecated With the use of APIs that are new in iOS 10 (e.g., here; see Apple's doc on that), it should be made explicit that pre-iOS 10 is no longer supported. (I'm not sure if pre-iOS 10 APIs were used before #66.) A good place to do that, in addition to the docs, is in the |
Added support for UNNotification in version 1.7.0 🎉 |
Feature Request
Make PushNotification compatible with iOS 10 new
UserNotifications Framework
Why it is needed
Xcode says
'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings
iOS 13 is almost there, so it is quite natural to ask this update ;)
Possible implementation
UNNotificationSettings
AppDelegate.m
The text was updated successfully, but these errors were encountered: