Skip to content

Crash in BNCReferringURLUtility when parsing URL (likely from Meta ads) #1491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
fjmorant opened this issue May 20, 2025 · 2 comments
Open

Comments

@fjmorant
Copy link

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

  1. Run an iOS app that integrates Branch and is configured to receive deep links from Meta/Facebook ads.

  2. Receive a deep link from a Meta ad campaign.

  3. Observe the app crash due to a failure in metaCampaignIDsFromDictionary: in BNCReferringURLUtility.m (line 104).

  4. 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

@fjmorant
Copy link
Author

PR created to solve this issue #1492

@fjmorant
Copy link
Author

There is already a release for fixing this bug here https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases/tag/3.12.1 could you do a react native release too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant