Fortunately, this is pretty straight forward. All you have to do is use the compiler directive, preferably in the header file, central to your push notifications. In the conditional directive, you can map your own set of constants using definitions, either to a new set or an outdated set, depending on the latest version of iOS supported by your xCode.
#ifdef __IPHONE_8_0 #define RemoteNotificationTypeAlert UIUserNotificationTypeAlert #define RemoteNotificationTypeBadge UIUserNotificationTypeBadge #define RemoteNotificationTypeSound UIUserNotificationTypeSound #define RemoteNotificationTypeNone UIUserNotificationTypeNone #else #define RemoteNotificationTypeAlert UIRemoteNotificationTypeAlert #define RemoteNotificationTypeBadge UIRemoteNotificationTypeBadge #define RemoteNotificationTypeSound UIRemoteNotificationTypeSound #define RemoteNotificationTypeNone UIRemoteNotificationTypeNone #endif
Sheamus
source share