Skip to content

Commit 3bdca42

Browse files
authored
Handle newly removed userInfo property on tvOS. (#3216)
The build is currently broken in Xcode 11 because of this.
1 parent ffdc328 commit 3bdca42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Firebase/Messaging/FIRMessagingExtensionHelper.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ - (void)populateNotificationContent:(UNMutableNotificationContent *)content
3535
self.contentHandler = [contentHandler copy];
3636
self.bestAttemptContent = content;
3737

38-
NSString *currentImageURL = content.userInfo[kPayloadOptionsName][kPayloadOptionsImageURLName];
38+
// The `userInfo` property isn't available on newer versions of tvOS.
39+
#if TARGET_OS_IOS || TARGET_OS_OSX
40+
NSString *currentImageURL = content.userInfo[kPayloadOptionsName][kPayloadOptionsImageURLName];
3941
if (!currentImageURL) {
4042
[self deliverNotification];
4143
return;
4244
}
43-
#if TARGET_OS_IOS || TARGET_OS_OSX
4445
NSURL *attachmentURL = [NSURL URLWithString:currentImageURL];
4546
if (attachmentURL) {
4647
[self loadAttachmentForURL:attachmentURL

0 commit comments

Comments
 (0)