Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Example/Messaging/Tests/FIRMessagingContextManagerServiceTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ - (void)testMessageWithFutureStartTime {
XCTAssertTrue([FIRMessagingContextManagerService handleContextManagerMessage:message]);

XCTAssertEqual(self.scheduledLocalNotifications.count, 1);

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
UILocalNotification *notification = [self.scheduledLocalNotifications firstObject];
#pragma clang diagnostic pop
NSDate *date = [self.dateFormatter dateFromString:startTimeString];
XCTAssertEqual([notification.fireDate compare:date], NSOrderedSame);
#endif
Expand Down Expand Up @@ -134,7 +136,10 @@ - (void)testMessageWithPastStartAndFutureEndTime {
XCTAssertTrue([FIRMessagingContextManagerService handleContextManagerMessage:message]);

XCTAssertEqual(self.scheduledLocalNotifications.count, 1);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
UILocalNotification *notification = [self.scheduledLocalNotifications firstObject];
#pragma clang diagnostic pop
// schedule notification after start date
XCTAssertEqual([notification.fireDate compare:startDate], NSOrderedDescending);
// schedule notification after end date
Expand Down Expand Up @@ -163,7 +168,10 @@ - (void)testTimedNotificationsUserInfo {
XCTAssertTrue([FIRMessagingContextManagerService handleContextManagerMessage:message]);

XCTAssertEqual(self.scheduledLocalNotifications.count, 1);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
UILocalNotification *notification = [self.scheduledLocalNotifications firstObject];
#pragma clang diagnostic pop
XCTAssertEqualObjects(notification.userInfo[messageIdentifierKey], messageIdentifier);
XCTAssertEqualObjects(notification.userInfo[customDataKey], customData);
#endif
Expand All @@ -175,6 +183,8 @@ - (void)testTimedNotificationsUserInfo {
- (void)mockSchedulingLocalNotifications {
#if TARGET_OS_IOS
id mockApplication = OCMPartialMock([UIApplication sharedApplication]);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
__block UILocalNotification *notificationToSchedule;
[[[mockApplication stub]
andDo:^(NSInvocation *invocation) {
Expand All @@ -189,6 +199,7 @@ - (void)mockSchedulingLocalNotifications {
}
return NO;
}]];
#pragma clang diagnostic pop
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion Firebase/Messaging/FIRMessaging.m
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ - (void)receiver:(FIRMessagingReceiver *)receiver
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
[self.delegate messaging:self didReceiveMessage:remoteMessage];
#pragma pop
#pragma clang diagnostic pop
} else {
// Delegate methods weren't implemented, so messages are being dropped, log a warning
FIRMessagingLoggerWarn(kFIRMessagingMessageCodeRemoteMessageDelegateMethodNotImplemented,
Expand Down
5 changes: 4 additions & 1 deletion Firebase/Messaging/FIRMessagingContextManagerService.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ + (void)scheduleLocalNotificationForMessage:(NSDictionary *)message
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
notification.alertTitle = apsDictionary[kFIRMessagingContextManagerTitleKey];
#pragma pop
#pragma clang diagnostic pop
}
}

Expand All @@ -175,7 +175,10 @@ + (void)scheduleLocalNotificationForMessage:(NSDictionary *)message
if (!application) {
return;
}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[application scheduleLocalNotification:notification];
#pragma clang diagnostic pop
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunguarded-availability"
const char *errorStr = sqlite3_errstr(result);
#pragma pop
#pragma clang diagnostic pop
NSString *errorString = [NSString stringWithFormat:@"%d - %s", result, errorStr];
return errorString;
}
Expand Down