From 92e5722c605737efc8cb2ce765f47b3a9f032a61 Mon Sep 17 00:00:00 2001 From: Joe Masilotti Date: Tue, 16 Dec 2014 11:34:13 -0500 Subject: [PATCH] Only register for notification if supported - iOS8 --- Test Host/SystemAlertViewController.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Test Host/SystemAlertViewController.m b/Test Host/SystemAlertViewController.m index 106317fb2..1aa700e81 100644 --- a/Test Host/SystemAlertViewController.m +++ b/Test Host/SystemAlertViewController.m @@ -33,8 +33,10 @@ - (IBAction)requestPhotosAccess { } - (IBAction)requestNotificationScheduling { - UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert categories:nil]; - [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; + if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) { + UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert categories:nil]; + [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; + } } @end