Skip to content

Commit 6ea70e5

Browse files
author
Arnaud Coomans
committed
Merge pull request acoomans#4 from TwiterZX/fix_sdk_compatibility_issue
[FIX] compatibly issue with older SDK
2 parents 3a0bf21 + f91379b commit 6ea70e5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

SimulatorRemoteNotifications/UIApplication+SimulatorRemoteNotifications.m

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ - (void)listenForRemoteNotifications {
5353
} else if (![dict isKindOfClass:[NSDictionary class]]) {
5454
NSLog(@"SimulatorRemoteNotification: message error (not a dictionary)");
5555
} else {
56-
if ([self.delegate respondsToSelector:@selector(application:didReceiveRemoteNotification:fetchCompletionHandler:)]) {
57-
[self.delegate application:self didReceiveRemoteNotification:dict fetchCompletionHandler:^(UIBackgroundFetchResult result) {}];
58-
}
59-
else if ([self.delegate respondsToSelector:@selector(application:didReceiveRemoteNotification:)]) {
60-
[self.delegate application:self didReceiveRemoteNotification:dict];
61-
}
56+
#ifdef __IPHONE_7_0
57+
if ([self.delegate respondsToSelector:@selector(application:didReceiveRemoteNotification:fetchCompletionHandler:)]) {
58+
[self.delegate application:self didReceiveRemoteNotification:dict fetchCompletionHandler:^(UIBackgroundFetchResult result) {}];
59+
}
60+
#else
61+
if ([self.delegate respondsToSelector:@selector(application:didReceiveRemoteNotification:)]) {
62+
[self.delegate application:self didReceiveRemoteNotification:dict];
63+
}
64+
#endif
6265
}
6366
});
6467
dispatch_source_set_cancel_handler(input_src, ^{

0 commit comments

Comments
 (0)