-
Notifications
You must be signed in to change notification settings - Fork 231
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
iOS Integration Validator 2.0 #1439
base: master
Are you sure you want to change the base?
Conversation
@NidhiDixit09 @nsingh-branch can you please review? this has been sitting idle for a while |
We had a meeting with Rob yesterday and I believe he's going to be combining the new deep linking validator into this PR as well. @rob-gioia-branch Is that correct? |
@nsingh-branch yes that is correct, going to merge the two branches together so that the code is in one PR, and the tests in one validator popup. Will do that soon so that folks can review! Thank you for the bump @ahmednawar ! :) |
NSArray *linkDomains = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"branch_universal_link_domains"]; | ||
|
||
for (NSString *domain in linkDomains) { | ||
if ([domain isEqualToString:serverLinkDomain]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sharath-branch linkdomains strings can have prefix applinks:
also. ( Suggested format is our docs is - applinks:subdomain.app.link https://help.branch.io/developers-hub/docs/ios-basic-integration#3-configure-associated-domains ) . So this check will fail if user adds applinks:
to domain in info.plist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is checking only the info.plist actually and not the associated domains. We recommend adding the prefix applinks:
only to associated domains. The recommendation is to add the domains directly to the info.plist without any prefix (https://help.branch.io/developers-hub/docs/ios-basic-integration#4-configure-infoplist).
@@ -165,6 +165,17 @@ + (BOOL)compareUriSchemes : (NSString *) serverUriScheme { | |||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sharath-branch At line no. 162, if code returns from here, it will not check second and more urlType
in array urlTypes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks!
Sources/BranchSDK/Branch+Validator.m
Outdated
case BranchLinkDomainError: | ||
return @"Check the link domain and alternate domain values in your info.plist file under the key 'branch_universal_link_domains'. The values should match with the ones on the Branch dashboard.\n\n"; | ||
case BranchURISchemeError: | ||
return @"The URI scheme in your info.plist file shoudl match with the URI scheme value for iOS on the Branch dashboard.\n\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - shoudl
should be should
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed :)
NSString *uriScheme = [BNCSystemObserver compareUriSchemes:serverUriScheme] ? passString : errorString; | ||
bool doUriSchemesMatch = [BNCSystemObserver compareUriSchemes:serverUriScheme]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor optimization -
bool doUriSchemesMatch = [BNCSystemObserver compareUriSchemes:serverUriScheme];
NSString *uriScheme = doUriSchemesMatch ? passString : errorString;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
@interface BranchFileLogger () | ||
|
||
@property (nonatomic, strong) NSString *logFilePath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property is not used anywhere. If its not required, it can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually a private property that's used in the functions within the class. Have fixed some functions to reference this property which was previously missing.
@@ -2107,6 +2107,8 @@ - (void)handleInitSuccessAndCallCallback:(BOOL)callCallback sceneIdentifier:(NSS | |||
id<NSObject> sharedApplication = [applicationClass performSelector:@selector(sharedApplication)]; | |||
if ([sharedApplication respondsToSelector:@selector(openURL:)]) | |||
[sharedApplication performSelector:@selector(openURL:) withObject:comp.URL]; | |||
} else if ([latestReferringParams[@"validate_integration"] isEqualToString:@"true"]) { | |||
[self validateSDKIntegration]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen if deep linking fails ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If deep linking fails completely, this will never trigger which is an outcome we are fine with. But there are multiple entry points to this function - let's say universal link launch fails, it will launch via URI scheme. If both of these fail, developer can try with the alternate link domain. The idea is that if this fails to load completely, we still have some understanding that the core issue is with the universal links setup itself.
As of today, debugging an issue is a blind spot for CX teams because the error could be anywhere. This function helps in breaking down the issue into (a). either the issue is fundamentally with the links setup (if the validator doesn't launch at all) or (b). the issue is one of the issues highlighted by the validator.
// | ||
// Created by Sharath Sriram on 15/10/24. | ||
// | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file supposed to be public ? Its mainly used by "Branch+Validator.h" which is inside private folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Reference
No related JIRA ticket, part of the initiative to improve the Branch SDK implementation QA process.
Summary
Enhanced the iOS Integration Validator with multiple quality of life changes to improve developer experience, aid our support team to debug faster and improve the overall integration testing process.
Motivation
The current iOS integration validator is a good first step for any developer to test their Branch iOS SDK integration. However, it is missing a few key details that can make it easy for the developer to validate their integration. Additionally, there are three key pain points that are solved as quality of life enhancements:
Type Of Change
Testing Instructions
There are a total of 8 new changes that can be observed through this PR.
validate_integration=true
as a query parameter to any Branch link and click on it to trigger the Integration Validator. This complements the old method beautifully to give developers two great ways to trigger the validator.https://github.com/user-attachments/assets/a14334cd-7764-42a8-bbf0-b4e7b12773ca
cc @BranchMetrics/saas-sdk-devs for visibility.