Skip to content

Commit a2d205c

Browse files
authored
[Messaging] Cleanup compilation guards for building on older SDKs (#12935)
1 parent 8e2c7b7 commit a2d205c

File tree

4 files changed

+4
-22
lines changed

4 files changed

+4
-22
lines changed

FirebaseMessaging/Sources/FIRMessaging.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,8 @@
4949
static NSString *const kFIRMessagingMessageViaAPNSRootKey = @"aps";
5050
static NSString *const kFIRMessagingReachabilityHostname = @"www.google.com";
5151

52-
#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
5352
const NSNotificationName FIRMessagingRegistrationTokenRefreshedNotification =
5453
@"com.firebase.messaging.notif.fcm-token-refreshed";
55-
#else
56-
NSString *const FIRMessagingRegistrationTokenRefreshedNotification =
57-
@"com.firebase.messaging.notif.fcm-token-refreshed";
58-
#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
5954

6055
NSString *const kFIRMessagingUserDefaultsKeyAutoInitEnabled =
6156
@"com.firebase.messaging.auto-init.enabled"; // Auto Init Enabled key stored in NSUserDefaults

FirebaseMessaging/Sources/FIRMessagingContextManagerService.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 || \
17-
__MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_14 || __TV_OS_VERSION_MAX_ALLOWED >= __TV_10_0 || \
18-
__WATCH_OS_VERSION_MAX_ALLOWED >= __WATCHOS_3_0 || TARGET_OS_MACCATALYST
16+
1917
#import <UserNotifications/UserNotifications.h>
20-
#endif
2118

2219
#import "FirebaseMessaging/Sources/FIRMessagingContextManagerService.h"
2320

FirebaseMessaging/Tests/UnitTests/FIRMessagingContextManagerServiceTest.m

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 || \
17-
__MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_14 || __TV_OS_VERSION_MAX_ALLOWED >= __TV_10_0 || \
18-
__WATCH_OS_VERSION_MAX_ALLOWED >= __WATCHOS_3_0 || TARGET_OS_MACCATALYST
19-
#import <UserNotifications/UserNotifications.h>
20-
#endif
16+
2117
#import <OCMock/OCMock.h>
18+
#import <UserNotifications/UserNotifications.h>
2219
#import <XCTest/XCTest.h>
2320

2421
#import "FirebaseMessaging/Sources/FIRMessagingContextManagerService.h"

FirebaseMessaging/Tests/UnitTests/FIRMessagingRemoteNotificationsProxyTest.m

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 || \
18-
__TV_OS_VERSION_MAX_ALLOWED >= __TV_10_0 || __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_14
19-
#import <UserNotifications/UserNotifications.h>
20-
#endif
2117
#import <OCMock/OCMock.h>
18+
#import <UserNotifications/UserNotifications.h>
2219
#import <XCTest/XCTest.h>
2320

2421
#import <GoogleUtilities/GULAppDelegateSwizzler.h>
@@ -95,8 +92,6 @@ - (void)application:(GULApplication *)application
9592

9693
@end
9794

98-
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 || \
99-
__TV_OS_VERSION_MAX_ALLOWED >= __TV_10_0 || __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_14
10095
#pragma mark - Incompete UNUserNotificationCenterDelegate
10196
@interface IncompleteUserNotificationCenterDelegate : NSObject <UNUserNotificationCenterDelegate>
10297
@end
@@ -127,8 +122,6 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
127122
#endif
128123
@end
129124

130-
#endif
131-
132125
@interface GULAppDelegateSwizzler (FIRMessagingRemoteNotificationsProxyTest)
133126
+ (void)resetProxyOriginalDelegateOnceToken;
134127
@end

0 commit comments

Comments
 (0)