-
Notifications
You must be signed in to change notification settings - Fork 243
Description
Describe the bug
We're encountering a fatal crash in our production iOS app due to an unhandled exception in BNCReferringURLUtility. The crash occurs when Branch is attempting to parse a referring URL, possibly containing unexpected data from a Meta (Facebook) ads campaign.
After stopping our Facebook ads campaigns, this crash has no longer occurred, which leads us to believe the issue is related to URL content generated by Meta.
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x11a2ec __exceptionPreprocess
1 libobjc.A.dylib 0x31a7c objc_exception_throw
2 CoreFoundation 0x18467c +[NSObject(NSObject) _copyDescription]
3 CoreFoundation 0x31b84 ___forwarding___
4 CoreFoundation 0x314f0 _CF_forwarding_prep_0
5 yachtworld 0x18620 -[BNCReferringURLUtility metaCampaignIDsFromDictionary:] + 104 (BNCReferringURLUtility.m:104)
6 yachtworld 0x184c4 -[BNCReferringURLUtility processMetaQueryParameter:] + 89 (BNCReferringURLUtility.m:89)
7 yachtworld 0x181f8 -[BNCReferringURLUtility parseReferringURL:] + 66 (BNCReferringURLUtility.m:66)
8 yachtworld 0x28a9c -[Branch handleDeepLink:sceneIdentifier:] + 771 (Branch.m:771)
9 yachtworld 0x29290 -[Branch application:openURL:options:] + 854 (Branch.m:854)
10 yachtworld 0x289f3c +[RNBranch application:openURL:options:] + 186 (RNBranch.m:186)
Steps to reproduce
-
Run an iOS app that integrates Branch and is configured to receive deep links from Meta/Facebook ads.
-
Receive a deep link from a Meta ad campaign.
-
Observe the app crash due to a failure in metaCampaignIDsFromDictionary: in BNCReferringURLUtility.m (line 104).
-
Stop Meta ad campaigns and observe that the crash no longer occurs.
Expected behavior
Open the app without crashes.
SDK Version
3.10.0
XCode Version
16.3
Device
Multiple iPhones
OS
18.x (and older too)
Additional Information/Context
No response