Skip to content

Commit 73bc2f6

Browse files
ncooke3subdiox
andauthored
[FirebaseMessaging] Fix Xcode 26 symbol crash (#15165)
Co-authored-by: subdiox <[email protected]>
1 parent feef47a commit 73bc2f6

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

FirebaseInAppMessaging/Sources/Runtime/FIRIAMActionURLFollower.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,9 @@ - (BOOL)followURLWithContinueUserActivity:(NSURL *)url {
175175
FIRLogDebug(kFIRLoggerInAppMessaging, @"I-IAM240004",
176176
@"App delegate responds to application:continueUserActivity:restorationHandler:."
177177
"Simulating action url opening from a web browser.");
178-
NSUserActivity *userActivity =
179-
[[NSUserActivity alloc] initWithActivityType:NSUserActivityTypeBrowsingWeb];
178+
// Use string literal to ensure compatibility with Xcode 26 and iOS 18
179+
NSString *browsingWebType = @"NSUserActivityTypeBrowsingWeb";
180+
NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:browsingWebType];
180181
userActivity.webpageURL = url;
181182
BOOL handled = [self.appDelegate application:self.mainApplication
182183
continueUserActivity:userActivity

FirebaseInAppMessaging/Tests/Unit/FIRIAMActionUrlFollowerTests.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ - (void)testUniversalLinkHandlingReturnYES {
8484
continueUserActivity:[OCMArg checkWithBlock:^BOOL(id userActivity) {
8585
// verifying the type and url field for the userActivity object
8686
NSUserActivity *activity = (NSUserActivity *)userActivity;
87-
return [activity.activityType
88-
isEqualToString:NSUserActivityTypeBrowsingWeb] &&
87+
// Use string literal to ensure compatibility with Xcode 26 and iOS 18
88+
NSString *browsingWebType = @"NSUserActivityTypeBrowsingWeb";
89+
return [activity.activityType isEqualToString:browsingWebType] &&
8990
[activity.webpageURL isEqual:url];
9091
}]
9192
restorationHandler:[OCMArg any]])

FirebaseMessaging/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 12.1.0
2+
- [fixed] Fix Xcode 26 crash from missing `NSUserActivityTypeBrowsingWeb`
3+
symbol. Note that this fix isn't in the 12.1.0 zip and Carthage
4+
distributions, but will be included from 12.2.0 onwards. (#15159)
5+
16
# 11.14.0
27
- [fixed] Fix a potential SQL injection issue. (#14846).
38

FirebaseMessaging/Sources/FIRMessaging.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@ - (void)handleIncomingLinkIfNeededFromMessage:(NSDictionary *)message {
400400
// if they haven't implemented it.
401401
if ([NSUserActivity class] != nil &&
402402
[appDelegate respondsToSelector:continueUserActivitySelector]) {
403-
NSUserActivity *userActivity =
404-
[[NSUserActivity alloc] initWithActivityType:NSUserActivityTypeBrowsingWeb];
403+
// Use string literal to ensure compatibility with Xcode 26 and iOS 18
404+
NSString *browsingWebType = @"NSUserActivityTypeBrowsingWeb";
405+
NSUserActivity *userActivity = [[NSUserActivity alloc] initWithActivityType:browsingWebType];
405406
userActivity.webpageURL = url;
406407
[appDelegate application:application
407408
continueUserActivity:userActivity

0 commit comments

Comments
 (0)