Skip to content
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

Validator isn't correctly displaying mismatched URI schemes when no scheme exists on the server #1463

Open
jamstop opened this issue Dec 26, 2024 · 0 comments

Comments

@jamstop
Copy link

jamstop commented Dec 26, 2024

Describe the bug

When no URI scheme has been set on the dashboard and an URI scheme has been set in info.plist, running Branch.getInstance().validateSDKIntegration() will cause the URI validation alert to claim that the client scheme matches the server scheme:

✅ URI Scheme matches:
  '<null>'

It looks like the validator is actually using a check between the client bundle ID and the server bundle ID to construct this part of the alert message:
https://github.com/BranchMetrics/ios-branch-sdk-spm/blob/3.7.0/Sources/BranchSDK/Branch%2BValidator.m#L77

The URI scheme validation itself seems to be working correctly when fetching <null> from the dashboard. However, I'm also getting an index error from a Staging version of our app from this part of the validation process which fetches an empty string from the server instead of <null>, which fails here:
https://github.com/BranchMetrics/ios-branch-sdk-spm/blob/3.7.0/Sources/BranchSDK/BNCSystemObserver.m#L160
This should probably be handled gracefully.

Steps to reproduce

  1. Set a URI scheme in an iOS project's info.plist, and no scheme on the Branch Dashboard.
  2. Run the project w/ Branch.getInstance().validateSDKIntegration()
  3. Observe that the Branch Validation Alert popup in-app shows a successful URI scheme validation with a match on '<null>'

Expected behavior

I expect the Branch Validation Alert displays that the URI scheme validation failed.

And sidebar re: index error, I expect that case to be handled gracefully as an error, at the very least by adding a check and return false around here: https://github.com/BranchMetrics/ios-branch-sdk-spm/blob/3.7.0/Sources/BranchSDK/BNCSystemObserver.m#L160

SDK Version

3.7.0

XCode Version

16.1

Device

iPhone 16

OS

18.0

Additional Information/Context

No response

@jamstop jamstop changed the title Validator isn't correctly displaying mismatched URI schemes Validator isn't correctly displaying mismatched URI schemes when no scheme exists on the server Dec 26, 2024
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