@@ -100,8 +100,14 @@ - (NSDictionary *)dataForInstallWithURLString:(NSString *)urlString {
100100 [self addAppleReceiptSourceToJSON: json];
101101 [self addTimestampsToJSON: json];
102102
103+ // Check if the urlString is a valid URL to ensure it's a universal link, not the external intent uri
103104 if (urlString) {
104- [self safeSetValue: urlString forKey: BRANCH_REQUEST_KEY_UNIVERSAL_LINK_URL onDict: json];
105+ NSURL *url = [NSURL URLWithString: urlString];
106+ if (url && ([url.scheme isEqualToString: @" http" ] || [url.scheme isEqualToString: @" https" ])) {
107+ [self safeSetValue: urlString forKey: BRANCH_REQUEST_KEY_UNIVERSAL_LINK_URL onDict: json];
108+ } else {
109+ [self safeSetValue: urlString forKey: BRANCH_REQUEST_KEY_EXTERNAL_INTENT_URI onDict: json];
110+ }
105111 }
106112
107113 [self addAppleAttributionTokenToJSON: json];
@@ -147,8 +153,15 @@ - (NSDictionary *)dataForOpenWithURLString:(NSString *)urlString {
147153 [self addAppleReceiptSourceToJSON: json];
148154 [self addTimestampsToJSON: json];
149155
156+
157+ // Check if the urlString is a valid URL to ensure it's a universal link, not the external intent uri
150158 if (urlString) {
151- [self safeSetValue: urlString forKey: BRANCH_REQUEST_KEY_UNIVERSAL_LINK_URL onDict: json];
159+ NSURL *url = [NSURL URLWithString: urlString];
160+ if (url && ([url.scheme isEqualToString: @" http" ] || [url.scheme isEqualToString: @" https" ])) {
161+ [self safeSetValue: urlString forKey: BRANCH_REQUEST_KEY_UNIVERSAL_LINK_URL onDict: json];
162+ } else {
163+ [self safeSetValue: urlString forKey: BRANCH_REQUEST_KEY_EXTERNAL_INTENT_URI onDict: json];
164+ }
152165 }
153166
154167 // Usually sent with install, but retry on open if it didn't get sent
0 commit comments