Skip to content

Commit 7075336

Browse files
committed
[Messaging] - Apply deprecated property fix to AppDelegate.m
1 parent cc09823 commit 7075336

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

messaging/MessagingExample/AppDelegate.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,15 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
122122
NSLog(@"%@", userInfo);
123123

124124
// Change this to your preferred presentation option
125-
completionHandler(UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionAlert);
125+
// Note: UNNotificationPresentationOptionAlert has been deprecated.
126+
if (@available(iOS 14.0, *)) {
127+
completionHandler(UNNotificationPresentationOptionList |
128+
UNNotificationPresentationOptionBanner |
129+
UNNotificationPresentationOptionSound);
130+
} else {
131+
completionHandler(UNNotificationPresentationOptionAlert |
132+
UNNotificationPresentationOptionSound);
133+
}
126134
}
127135

128136
// Handle notification messages after display notification is tapped by the user.

0 commit comments

Comments
 (0)