I am trying to compile an existing application using Xcode 6.
This is my code:
UIUserNotificationSettings *settings = [UIApplication.sharedApplication currentUserNotificationSettings];
This is my error:
use of undeclared identifier 'UIUserNotificationSettings'
I do not know how to resolve this issue.
Here is my check for iOS 8:
if (SYSTEM_VERSION_LESS_THAN(_iOS_8_0)) {
// Displaying notifications and ringing
if ([self isMissingMandatoryNotificationTypes:[UIApplication.sharedApplication enabledRemoteNotificationTypes]]) {
[self registrationWithSuccess:^{
DDLogInfo(@"Push notifications were succesfully re-enabled");
} failure:^{
[self.missingPermissionsAlertView show];
}];
}
} else {
// UIUserNotificationsSettings
UIUserNotificationSettings *settings = [UIApplication.sharedApplication currentUserNotificationSettings];
make it this way:
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000
UIUserNotificationSettings *settings = [UIApplication.sharedApplication currentUserNotificationSettings];
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With