diff --git a/Example/Messaging/Tests/FIRMessagingServiceTest.m b/Example/Messaging/Tests/FIRMessagingServiceTest.m index 9afdced12ae..073adad1a29 100644 --- a/Example/Messaging/Tests/FIRMessagingServiceTest.m +++ b/Example/Messaging/Tests/FIRMessagingServiceTest.m @@ -146,12 +146,15 @@ - (void)testSubscribeWithInvalidTopic { XCTestExpectation *exceptionExpectation = [self expectationWithDescription:@"Should throw exception for invalid token"]; @try { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" [messaging.pubsub subscribeWithToken:@"abcdef1234" topic:nil options:nil handler:^(NSError *error) { XCTFail(@"Should not invoke the handler"); }]; +#pragma clang diagnostic pop } @catch (NSException *exception) { [exceptionExpectation fulfill]; @@ -169,12 +172,15 @@ - (void)testUnsubscribeWithInvalidTopic { XCTestExpectation *exceptionExpectation = [self expectationWithDescription:@"Should throw exception for invalid token"]; @try { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" [messaging.pubsub unsubscribeWithToken:@"abcdef1234" topic:nil options:nil handler:^(NSError *error) { XCTFail(@"Should not invoke the handler"); }]; +#pragma clang diagnostic pop } @catch (NSException *exception) { [exceptionExpectation fulfill]; diff --git a/Firebase/Messaging/FIRMessagingPubSub.h b/Firebase/Messaging/FIRMessagingPubSub.h index b2498660000..1c615d18d48 100644 --- a/Firebase/Messaging/FIRMessagingPubSub.h +++ b/Firebase/Messaging/FIRMessagingPubSub.h @@ -70,7 +70,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)subscribeWithToken:(NSString *)token topic:(NSString *)topic - options:(NSDictionary *)options + options:(nullable NSDictionary *)options handler:(FIRMessagingTopicOperationCompletion)handler; /** @@ -92,7 +92,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)unsubscribeWithToken:(NSString *)token topic:(NSString *)topic - options:(NSDictionary *)options + options:(nullable NSDictionary *)options handler:(FIRMessagingTopicOperationCompletion)handler; /**