36
36
37
37
@interface FIRMessagingContextManagerService (ExposedForTest)
38
38
+ (void )scheduleiOS10LocalNotificationForMessage : (NSDictionary *)message atDate : (NSDate *)date ;
39
- + (UNMutableNotificationContent *)contentFromContextualMessage : (NSDictionary *)message ;
39
+ + (UNMutableNotificationContent *)contentFromContextualMessage : (NSDictionary *)message
40
+ API_AVAILABLE(macos(10.14 ));
40
41
@end
41
42
42
43
API_AVAILABLE (macos(10.14 ))
43
44
@interface FIRMessagingContextManagerServiceTest : XCTestCase
44
45
45
46
@property(nonatomic, readwrite, strong) NSDateFormatter *dateFormatter;
46
47
@property(nonatomic, readwrite, strong) NSMutableArray *scheduledLocalNotifications;
47
- @property(nonatomic, readwrite, strong)
48
- NSMutableArray <UNNotificationRequest *> *requests API_AVAILABLE (ios(10.0 ), macos(10.4 ));
48
+ @property (nonatomic , readwrite , strong ) NSMutableArray <UNNotificationRequest *> *requests;
49
49
50
50
@end
51
51
@@ -57,7 +57,7 @@ - (void)setUp {
57
57
self.dateFormatter .locale = [NSLocale localeWithLocaleIdentifier: @" en_US_POSIX" ];
58
58
[self .dateFormatter setDateFormat: @" yyyy-MM-dd HH:mm:ss" ];
59
59
self.scheduledLocalNotifications = [[NSMutableArray alloc ] init ];
60
- if (@available (macOS 10.14 , iOS 10.0 , watchOS 3.0 , tvOS 10.0 , *)) {
60
+ if (@available (macOS 10.14 , *)) {
61
61
self.requests = [[NSMutableArray alloc ] init ];
62
62
}
63
63
@@ -104,7 +104,7 @@ - (void)testMessageWithFutureStartTime {
104
104
};
105
105
XCTAssertTrue ([FIRMessagingContextManagerService handleContextManagerMessage: message]);
106
106
107
- if (@available (macOS 10.14 , iOS 10.0 , watchOS 3.0 , tvOS 10.0 , *)) {
107
+ if (@available (macOS 10.14 , *)) {
108
108
XCTAssertEqual (self.requests .count , 1 );
109
109
UNNotificationRequest *request = self.requests .firstObject ;
110
110
XCTAssertEqualObjects (request.identifier , kMessageIdentifierValue );
@@ -146,7 +146,7 @@ - (void)testMessageWithPastEndTime {
146
146
};
147
147
148
148
XCTAssertTrue ([FIRMessagingContextManagerService handleContextManagerMessage: message]);
149
- if (@available (macOS 10.14 , iOS 10.0 , watchOS 3.0 , tvOS 10.0 , *)) {
149
+ if (@available (macOS 10.14 , *)) {
150
150
XCTAssertEqual (self.requests .count , 0 );
151
151
return ;
152
152
}
@@ -176,7 +176,7 @@ - (void)testMessageWithPastStartAndFutureEndTime {
176
176
177
177
XCTAssertTrue ([FIRMessagingContextManagerService handleContextManagerMessage: message]);
178
178
179
- if (@available (macOS 10.14 , iOS 10.0 , watchOS 3.0 , tvOS 10.0 , *)) {
179
+ if (@available (macOS 10.14 , *)) {
180
180
XCTAssertEqual (self.requests .count , 1 );
181
181
UNNotificationRequest *request = self.requests .firstObject ;
182
182
XCTAssertEqualObjects (request.identifier , kMessageIdentifierValue );
@@ -216,7 +216,7 @@ - (void)testTimedNotificationsUserInfo {
216
216
};
217
217
218
218
XCTAssertTrue ([FIRMessagingContextManagerService handleContextManagerMessage: message]);
219
- if (@available (macOS 10.14 , iOS 10.0 , watchOS 3.0 , tvOS 10.0 , *)) {
219
+ if (@available (macOS 10.14 , *)) {
220
220
XCTAssertEqual (self.requests .count , 1 );
221
221
UNNotificationRequest *request = self.requests .firstObject ;
222
222
XCTAssertEqualObjects (request.identifier , kMessageIdentifierValue );
@@ -278,7 +278,7 @@ - (void)mockSchedulingLocalNotifications {
278
278
}
279
279
280
280
- (void )testScheduleiOS10LocalNotification {
281
- if (@available (macOS 10.14 , iOS 10.0 , watchOS 3.0 , tvOS 10.0 , *)) {
281
+ if (@available (macOS 10.14 , *)) {
282
282
id mockContextManagerService = OCMClassMock ([FIRMessagingContextManagerService class ]);
283
283
NSDictionary *message = @{};
284
284
@@ -290,7 +290,7 @@ - (void)testScheduleiOS10LocalNotification {
290
290
}
291
291
292
292
- (void )testContentFromConetxtualMessage {
293
- if (@available (macOS 10.14 , iOS 10.0 , watchOS 3.0 , tvOS 10.0 , *)) {
293
+ if (@available (macOS 10.14 , *)) {
294
294
NSDictionary *message = @{
295
295
@" aps" : @{@" content-available" : @1 },
296
296
@" gcm.message_id" : @1623702615599207 ,
0 commit comments