From a04e41204ec32b71da01ed2dee8687241e0a1439 Mon Sep 17 00:00:00 2001 From: mars-lan Date: Sun, 18 Jun 2017 11:33:53 -0700 Subject: [PATCH] Improve iOS 8 compatibility. --- RNNotificationActions/RNNotificationActions.m | 7 +++++-- .../RNNotificationActions.xcodeproj/project.pbxproj | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/RNNotificationActions/RNNotificationActions.m b/RNNotificationActions/RNNotificationActions.m index 1af5f5d..755fa78 100644 --- a/RNNotificationActions/RNNotificationActions.m +++ b/RNNotificationActions/RNNotificationActions.m @@ -75,7 +75,10 @@ - (UIMutableUserNotificationAction *)actionFromJSON:(NSDictionary *)opts UIMutableUserNotificationAction *action; action = [[UIMutableUserNotificationAction alloc] init]; [action setActivationMode: [RCTConvert UIUserNotificationActivationMode:opts[@"activationMode"]]]; - [action setBehavior: [RCTConvert UIUserNotificationActionBehavior:opts[@"behavior"]]]; + + if ([action respondsToSelector:@selector(setBehavior:)]) { + [action setBehavior: [RCTConvert UIUserNotificationActionBehavior:opts[@"behavior"]]]; + } [action setTitle:opts[@"title"]]; [action setIdentifier:opts[@"identifier"]]; [action setDestructive:[RCTConvert BOOL:opts[@"destructive"]]]; @@ -169,4 +172,4 @@ - (void)handleNotificationActionReceived:(NSNotification *)notification body:notification.userInfo]; } -@end \ No newline at end of file +@end diff --git a/RNNotificationActions/RNNotificationActions.xcodeproj/project.pbxproj b/RNNotificationActions/RNNotificationActions.xcodeproj/project.pbxproj index 0e8be22..da9c039 100644 --- a/RNNotificationActions/RNNotificationActions.xcodeproj/project.pbxproj +++ b/RNNotificationActions/RNNotificationActions.xcodeproj/project.pbxproj @@ -169,7 +169,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -206,7 +206,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES;