Skip to content

Commit ef3b826

Browse files
authored
Merge pull request #1288 from BranchMetrics/SDK-1982-SKAN-Simplification-DB-Updates
SDK-1982 SKAN Simplification DB Updates
2 parents 35cf189 + da55b9e commit ef3b826

File tree

11 files changed

+57
-10
lines changed

11 files changed

+57
-10
lines changed

.github/workflows/pre-release-qa.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
uses: actions/checkout@v3
1111
- name: Install pod, build project and run tests
1212
run: |
13+
echo "branch=${{ github.ref }}" >> $GITHUB_OUTPUT
1314
./scripts/getSimulator
1415
DESTINATION="platform=iOS Simulator,name=$(cat ./iphoneSim),OS=latest"
1516
cd SDKIntegrationTestApps/iOSReleaseTest-Cocoapods/

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 = "2.2.0"
3+
s.version = "2.2.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
@@ -1993,7 +1993,7 @@
19931993
"@executable_path/Frameworks",
19941994
"@loader_path/Frameworks",
19951995
);
1996-
MARKETING_VERSION = 2.2.0;
1996+
MARKETING_VERSION = 2.2.1;
19971997
PRODUCT_BUNDLE_IDENTIFIER = io.branch.BranchSDK;
19981998
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
19991999
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -2024,7 +2024,7 @@
20242024
"@executable_path/Frameworks",
20252025
"@loader_path/Frameworks",
20262026
);
2027-
MARKETING_VERSION = 2.2.0;
2027+
MARKETING_VERSION = 2.2.1;
20282028
PRODUCT_BUNDLE_IDENTIFIER = io.branch.BranchSDK;
20292029
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
20302030
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -2226,7 +2226,7 @@
22262226
"@loader_path/Frameworks",
22272227
);
22282228
MACH_O_TYPE = staticlib;
2229-
MARKETING_VERSION = 2.2.0;
2229+
MARKETING_VERSION = 2.2.1;
22302230
PRODUCT_BUNDLE_IDENTIFIER = io.branch.BranchSDK;
22312231
PRODUCT_MODULE_NAME = BranchSDK;
22322232
PRODUCT_NAME = BranchSDK;
@@ -2261,7 +2261,7 @@
22612261
"@loader_path/Frameworks",
22622262
);
22632263
MACH_O_TYPE = staticlib;
2264-
MARKETING_VERSION = 2.2.0;
2264+
MARKETING_VERSION = 2.2.1;
22652265
PRODUCT_BUNDLE_IDENTIFIER = io.branch.BranchSDK;
22662266
PRODUCT_MODULE_NAME = BranchSDK;
22672267
PRODUCT_NAME = BranchSDK;
@@ -2293,7 +2293,7 @@
22932293
"@executable_path/Frameworks",
22942294
"@loader_path/Frameworks",
22952295
);
2296-
MARKETING_VERSION = 2.2.0;
2296+
MARKETING_VERSION = 2.2.1;
22972297
PRODUCT_BUNDLE_IDENTIFIER = io.branch.BranchSDK;
22982298
PRODUCT_NAME = BranchSDK;
22992299
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -2323,7 +2323,7 @@
23232323
"@executable_path/Frameworks",
23242324
"@loader_path/Frameworks",
23252325
);
2326-
MARKETING_VERSION = 2.2.0;
2326+
MARKETING_VERSION = 2.2.1;
23272327
PRODUCT_BUNDLE_IDENTIFIER = io.branch.BranchSDK;
23282328
PRODUCT_NAME = BranchSDK;
23292329
PROVISIONING_PROFILE_SPECIFIER = "";

BranchSDK/BNCConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
NSString * const BNC_API_BASE_URL = @"https://api2.branch.io";
1212
NSString * const BNC_API_VERSION = @"v1";
1313
NSString * const BNC_LINK_URL = @"https://bnc.lt";
14-
NSString * const BNC_SDK_VERSION = @"2.2.0";
14+
NSString * const BNC_SDK_VERSION = @"2.2.1";
1515
NSString * const BNC_CDN_URL = @"https://cdn.branch.io";
1616

1717
NSString* const BNC_API_URL = @"https://api3.branch.io";

BranchSDK/BNCSKAdNetwork.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ - (BOOL) shouldCallPostbackForDataResponse:(NSDictionary *) dataResponseDictiona
183183
}
184184

185185
int highestConversionValue = (int)[BNCPreferenceHelper sharedInstance].highestConversionValueSent;
186-
if( conversionValue.intValue <= highestConversionValue ){
186+
if((currentWindow == BranchSkanWindowFirst) && (conversionValue.intValue <= highestConversionValue)){
187+
BOOL ascendingOnly = [self getAscendingOnlyFromDataResponse:dataResponseDictionary];
188+
if (!ascendingOnly)
189+
shouldCallUpdatePostback = YES;
190+
} else if ((currentWindow != BranchSkanWindowFirst) && (highestConversionValue != 0) && (conversionValue.intValue <= highestConversionValue)){ // In second and third windows, conversion values can be negative, so added extra check here.
187191
BOOL ascendingOnly = [self getAscendingOnlyFromDataResponse:dataResponseDictionary];
188192
if (!ascendingOnly)
189193
shouldCallUpdatePostback = YES;

BranchSDK/BranchConstants.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,8 @@ extern NSString * const BRANCH_REQUEST_KEY_APPLE_ATTRIBUTION_TOKEN;
161161

162162
extern NSString * const BRANCH_CRASHLYTICS_SDK_VERSION_KEY;
163163
extern NSString * const BRANCH_CRASHLYTICS_LOW_MEMORY_KEY;
164+
165+
extern NSString * const BRANCH_REQUEST_KEY_SKAN_POSTBACK_INDEX;
166+
extern NSString * const BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_0;
167+
extern NSString * const BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_1;
168+
extern NSString * const BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_2;

BranchSDK/BranchConstants.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,8 @@
159159
NSString * const BRANCH_CRASHLYTICS_LOW_MEMORY_KEY = @"io.branch.device.lowmemory";
160160

161161
NSString * const BRANCH_REQUEST_KEY_EXTERNAL_INTENT_URI = @"external_intent_uri";
162+
163+
NSString * const BRANCH_REQUEST_KEY_SKAN_POSTBACK_INDEX = @"skan_postback_index";
164+
NSString * const BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_0 = @"postback-sequence-index-0";
165+
NSString * const BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_1 = @"postback-sequence-index-1";
166+
NSString * const BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_2 = @"postback-sequence-index-2";

BranchSDK/BranchEvent.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,19 @@ - (NSDictionary *)buildEventDictionary {
351351
eventDictionary[BRANCH_REQUEST_KEY_PARTNER_PARAMETERS] = partnerParameters;
352352
}
353353

354+
if (@available(iOS 16.1, macCatalyst 16.1, *)){
355+
if ([BNCPreferenceHelper sharedInstance].invokeRegisterApp) {
356+
int currentWindow = [[BNCSKAdNetwork sharedInstance] calculateSKANWindowForTime:[NSDate date]];
357+
if (currentWindow == BranchSkanWindowFirst){
358+
eventDictionary[BRANCH_REQUEST_KEY_SKAN_POSTBACK_INDEX] = BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_0;
359+
} else if (currentWindow == BranchSkanWindowSecond) {
360+
eventDictionary[BRANCH_REQUEST_KEY_SKAN_POSTBACK_INDEX] = BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_1;
361+
} else if (currentWindow == BranchSkanWindowThird) {
362+
eventDictionary[BRANCH_REQUEST_KEY_SKAN_POSTBACK_INDEX] = BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_2;
363+
}
364+
}
365+
}
366+
354367
return eventDictionary;
355368
}
356369

BranchSDK/BranchOpenRequest.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,19 @@ - (void)makeRequest:(BNCServerInterface *)serverInterface key:(NSString *)key ca
110110
params[@"first_install_time"] = BNCWireFormatFromDate(application.firstInstallDate);
111111
params[@"update"] = [self.class appUpdateState];
112112

113+
if (@available(iOS 16.1, macCatalyst 16.1, *)){
114+
if ([BNCPreferenceHelper sharedInstance].invokeRegisterApp) {
115+
int currentWindow = [[BNCSKAdNetwork sharedInstance] calculateSKANWindowForTime:[NSDate date]];
116+
if (currentWindow == BranchSkanWindowFirst){
117+
params[BRANCH_REQUEST_KEY_SKAN_POSTBACK_INDEX] = BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_0;
118+
} else if (currentWindow == BranchSkanWindowSecond) {
119+
params[BRANCH_REQUEST_KEY_SKAN_POSTBACK_INDEX] = BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_1;
120+
} else if (currentWindow == BranchSkanWindowThird) {
121+
params[BRANCH_REQUEST_KEY_SKAN_POSTBACK_INDEX] = BRANCH_REQUEST_KEY_VALUE_POSTBACK_SEQUENCE_INDEX_2;
122+
}
123+
}
124+
}
125+
113126
[serverInterface postRequest:params
114127
url:[preferenceHelper
115128
getAPIURL:BRANCH_REQUEST_ENDPOINT_OPEN]

ChangeLog.md

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

3+
V.2.2.1
4+
5+
Branch iOS SDK 2.2.1 adds parameter for current SKAN 4.0 Window in /v1/open and /v2/event requests.
6+
7+
- SDK-1982 - SKAN Simplification DB updates
8+
39
V.2.2.0
410

511
Branch iOS SDK 2.2.0 adds the ability to include developer ID in installs and a new method to change the Branch API base URL.

0 commit comments

Comments
 (0)