Skip to content

Commit 26d4a43

Browse files
committed
Release 3.12.1 Updates.
1 parent c68af05 commit 26d4a43

File tree

7 files changed

+44
-9
lines changed

7 files changed

+44
-9
lines changed

Branch-TestBed/Branch-SDK-Tests/BNCReferringURLUtilityTests.m

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ - (void)testReferringURLWithNoParams {
7979
XCTAssert([expected isEqualToDictionary:params]);
8080
}
8181

82+
- (void)testNilReferringURL {
83+
NSURL *url = nil;
84+
NSDictionary *expected = @{};
85+
86+
BNCReferringURLUtility *utility = [self referringUtilityForTests];
87+
[utility parseReferringURL:url];
88+
NSDictionary *params = [utility referringURLQueryParamsForEndpoint:openEndpoint];
89+
90+
XCTAssert([expected isEqualToDictionary:params]);
91+
}
92+
8293
- (void)testReferringURLIgnoredParam {
8394
NSURL *url = [NSURL URLWithString:@"https://bnctestbed.app.link?other=12345"];
8495
NSDictionary *expected = @{ };
@@ -228,6 +239,17 @@ - (void)testReferringURLWithGclidOverwritesValue {
228239
XCTAssert([expected2 isEqualToDictionary:params2]);
229240
}
230241

242+
- (void)testReferringURLWithMetaCampaignIdsAndInvalidURL {
243+
NSURL *url = [NSURL URLWithString:@"https://bnctestbed.app.link?al_applink_data=[]#target_url%22%3A%22http%3A%5C%2F%5C%2Fitunes.apple.com%5C%2Fapp%5C%2Fid880047117%22%2C%22extras%22%3A%7B%22fb_app_id%22%3A2020399148181142%7D%2C%22referer_app_link%22%3A%7B%22url%22%3A%22fb%3A%5C%2F%5C%2F%5C%2F%3Fapp_id%3D2020399148181142%22%2C%22app_name%22%3A%22Facebook%22%7D%2C%22acs_token%22%3A%22debuggingtoken%22%2C%22campaign_ids%22%3A%22ARFUlbyOurYrHT2DsknR7VksCSgN4tiH8TzG8RIvVoUQoYog5bVCvADGJil5kFQC6tQm-fFJQH0w8wCi3NbOmEHHrtgCNglkXNY-bECEL0aUhj908hIxnBB0tchJCqwxHjorOUqyk2v4bTF75PyWvxOksZ6uTzBmr7wJq8XnOav0bA%22%2C%22test_deeplink%22%3A1%7D"];
244+
NSDictionary *expected = @{};
245+
246+
BNCReferringURLUtility *utility = [self referringUtilityForTests];
247+
[utility parseReferringURL:url];
248+
NSDictionary *params = [utility referringURLQueryParamsForEndpoint:openEndpoint];
249+
250+
XCTAssert([expected isEqualToDictionary:params]);
251+
}
252+
231253
- (void)testReferringURLWithMetaCampaignIds {
232254
NSURL *url = [NSURL URLWithString:@"https://bnctestbed.app.link?al_applink_data=%7B%22target_url%22%3A%22http%3A%5C%2F%5C%2Fitunes.apple.com%5C%2Fapp%5C%2Fid880047117%22%2C%22extras%22%3A%7B%22fb_app_id%22%3A2020399148181142%7D%2C%22referer_app_link%22%3A%7B%22url%22%3A%22fb%3A%5C%2F%5C%2F%5C%2F%3Fapp_id%3D2020399148181142%22%2C%22app_name%22%3A%22Facebook%22%7D%2C%22acs_token%22%3A%22debuggingtoken%22%2C%22campaign_ids%22%3A%22ARFUlbyOurYrHT2DsknR7VksCSgN4tiH8TzG8RIvVoUQoYog5bVCvADGJil5kFQC6tQm-fFJQH0w8wCi3NbOmEHHrtgCNglkXNY-bECEL0aUhj908hIxnBB0tchJCqwxHjorOUqyk2v4bTF75PyWvxOksZ6uTzBmr7wJq8XnOav0bA%22%2C%22test_deeplink%22%3A1%7D"];
233255
NSDictionary *expected = @{

BranchSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "BranchSDK"
3-
s.version = "3.12.0"
3+
s.version = "3.12.1"
44
s.summary = "Create an HTTP URL for any piece of content in your app"
55
s.description = <<-DESC
66
- Want the highest possible conversions on your sharing feature?

BranchSDK.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@
20162016
"@executable_path/Frameworks",
20172017
"@loader_path/Frameworks",
20182018
);
2019-
MARKETING_VERSION = 3.12.0;
2019+
MARKETING_VERSION = 3.12.1;
20202020
OTHER_LDFLAGS = (
20212021
"-weak_framework",
20222022
LinkPresentation,
@@ -2051,7 +2051,7 @@
20512051
"@executable_path/Frameworks",
20522052
"@loader_path/Frameworks",
20532053
);
2054-
MARKETING_VERSION = 3.12.0;
2054+
MARKETING_VERSION = 3.12.1;
20552055
OTHER_LDFLAGS = (
20562056
"-weak_framework",
20572057
LinkPresentation,
@@ -2257,7 +2257,7 @@
22572257
"@loader_path/Frameworks",
22582258
);
22592259
MACH_O_TYPE = staticlib;
2260-
MARKETING_VERSION = 3.12.0;
2260+
MARKETING_VERSION = 3.12.1;
22612261
OTHER_LDFLAGS = (
22622262
"-weak_framework",
22632263
LinkPresentation,
@@ -2296,7 +2296,7 @@
22962296
"@loader_path/Frameworks",
22972297
);
22982298
MACH_O_TYPE = staticlib;
2299-
MARKETING_VERSION = 3.12.0;
2299+
MARKETING_VERSION = 3.12.1;
23002300
OTHER_LDFLAGS = (
23012301
"-weak_framework",
23022302
LinkPresentation,
@@ -2333,7 +2333,7 @@
23332333
"@executable_path/Frameworks",
23342334
"@loader_path/Frameworks",
23352335
);
2336-
MARKETING_VERSION = 3.12.0;
2336+
MARKETING_VERSION = 3.12.1;
23372337
OTHER_LDFLAGS = (
23382338
"-weak_framework",
23392339
LinkPresentation,
@@ -2368,7 +2368,7 @@
23682368
"@executable_path/Frameworks",
23692369
"@loader_path/Frameworks",
23702370
);
2371-
MARKETING_VERSION = 3.12.0;
2371+
MARKETING_VERSION = 3.12.1;
23722372
OTHER_LDFLAGS = (
23732373
"-weak_framework",
23742374
LinkPresentation,

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Branch iOS SDK Change Log
22

3+
v.3.12.1
4+
- Fixed bug - SDK crashes when Meta AEM query param `al_applink_data` is empty.
5+
36
v.3.12.0
47
- Added browser experience for apps that have opted in. WebURL will open in in-app browser if app is linked with SafariServices.framework otherwise it will open in external browser.
58

Sources/BranchSDK/BNCConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "BNCConfig.h"
1010

11-
NSString * const BNC_SDK_VERSION = @"3.12.0";
11+
NSString * const BNC_SDK_VERSION = @"3.12.1";
1212
NSString * const BNC_LINK_URL = @"https://bnc.lt";
1313
NSString * const BNC_CDN_URL = @"https://cdn.branch.io";
1414

Sources/BranchSDK/BNCReferringURLUtility.m

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ - (void)dealloc {
4848
- (void)parseReferringURL:(NSURL *)url {
4949
[[BranchLogger shared] logVerbose:[NSString stringWithFormat:@"Parsing URL %@", url] error:nil];
5050

51+
if (!url) {
52+
[[BranchLogger shared] logVerbose:@"URL is nil" error:nil];
53+
return;
54+
}
55+
5156
NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
5257
for (NSURLQueryItem *item in components.queryItems) {
5358
if ([self isSupportedQueryParameter:item.name]) {
@@ -115,6 +120,11 @@ - (NSDictionary *)dictionaryFromEncodedJsonString:(NSString *)encodedJsonString
115120
if (jsonData) {
116121
NSError *error;
117122
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
123+
if (![json isKindOfClass:[NSDictionary class]]) {
124+
[[BranchLogger shared] logVerbose:@"Encoded json string did not decode to a dictionary; skipping" error:nil];
125+
json = nil;
126+
}
127+
118128
if (!error) {
119129
return json;
120130
} else {

scripts/version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Options:
3030
USAGE
3131
}
3232

33-
version=3.12.0
33+
version=3.12.1
3434
prev_version="$version"
3535

3636
if (( $# == 0 )); then

0 commit comments

Comments
 (0)