Skip to content

Commit 6cae3b8

Browse files
Merge pull request #196 from BranchMetrics/Release-8.4.0
[SDK-2525] Added CPP level support to Capacitor and release 8.4.0
2 parents ad24173 + d753cfd commit 6cae3b8

File tree

11 files changed

+95
-14
lines changed

11 files changed

+95
-14
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
Branch Capacitor SDK change log
22

3+
- 8.4.0
4+
5+
- Exposed new method `setConsumerProtectionAttributionLevel` to set CPP level
6+
- Branch Android SDK bumped to 5.15.1
7+
- Branch iOS SDK bumped to 3.9.0
8+
- Updated @capacitor/ios to 6.2.0
9+
310
- 8.3.0
411

512
- Branch Android SDK bumped to 5.13.0

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ dependencies {
6666
implementation project(':capacitor-android')
6767
implementation 'androidx.annotation:annotation:1.4.0'
6868
implementation 'androidx.appcompat:appcompat:1.5.0'
69-
api 'io.branch.sdk.android:library:5.13.0'
69+
api 'io.branch.sdk.android:library:5.15.1'
7070
testImplementation "junit:junit:$junitVersion"
7171
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
7272
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"

android/src/main/java/co/boundstate/BranchDeepLinks.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import io.branch.referral.BranchError;
1919
import io.branch.referral.BranchShareSheetBuilder;
2020
import io.branch.referral.BranchShortLinkBuilder;
21+
import io.branch.referral.Defines;
2122
import io.branch.referral.QRCode.BranchQRCode;
2223
import io.branch.referral.SharingHelper;
2324
import io.branch.referral.util.BRANCH_STANDARD_EVENT;
@@ -549,4 +550,35 @@ public void setDMAParamsForEEA(PluginCall call) {
549550

550551
call.resolve();
551552
}
553+
554+
@PluginMethod
555+
public void setConsumerProtectionAttributionLevel(PluginCall call) {
556+
String level = call.getString("level");
557+
if (level == null) {
558+
call.reject("Must provide a valid attribution level");
559+
return;
560+
}
561+
562+
Defines.BranchAttributionLevel attributionLevel;
563+
switch (level) {
564+
case "FULL":
565+
attributionLevel = Defines.BranchAttributionLevel.FULL;
566+
break;
567+
case "REDUCED":
568+
attributionLevel = Defines.BranchAttributionLevel.REDUCED;
569+
break;
570+
case "MINIMAL":
571+
attributionLevel = Defines.BranchAttributionLevel.MINIMAL;
572+
break;
573+
case "NONE":
574+
attributionLevel = Defines.BranchAttributionLevel.NONE;
575+
break;
576+
default:
577+
call.reject("Invalid attribution level provided");
578+
return;
579+
}
580+
581+
Branch.getInstance().setConsumerProtectionAttributionLevel(attributionLevel);
582+
call.resolve();
583+
}
552584
}

ios/Plugin/BranchService.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,24 @@ class BranchService {
7070
completion(NSError(domain: "Invalid URL", code: 400, userInfo: nil))
7171
}
7272
}
73+
74+
func setConsumerProtectionAttributionLevel(level: String) -> Void {
75+
var attributionLevel: BranchAttributionLevel
76+
77+
switch level {
78+
case "FULL":
79+
attributionLevel = BranchAttributionLevel.full
80+
case "REDUCED":
81+
attributionLevel = BranchAttributionLevel.reduced
82+
case "MINIMAL":
83+
attributionLevel = BranchAttributionLevel.minimal
84+
case "NONE":
85+
attributionLevel = BranchAttributionLevel.none
86+
default:
87+
return
88+
}
89+
90+
Branch.getInstance().setConsumerProtectionAttributionLevel(attributionLevel)
91+
}
92+
7393
}

ios/Plugin/Plugin.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@
1717
CAP_PLUGIN_METHOD(getFirstReferringParams, CAPPluginReturnPromise);
1818
CAP_PLUGIN_METHOD(setDMAParamsForEEA, CAPPluginReturnPromise);
1919
CAP_PLUGIN_METHOD(handleUrl, CAPPluginReturnPromise);
20+
CAP_PLUGIN_METHOD(setConsumerProtectionAttributionLevel, CAPPluginReturnPromise);
21+
2022
)

ios/Plugin/Plugin.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class BranchDeepLinks: CAPPlugin {
1616
object: nil
1717
)
1818

19-
Branch.getInstance().registerPluginName("Capacitor", version: "8.3.0")
19+
Branch.getInstance().registerPluginName("Capacitor", version: "8.4.0")
2020
}
2121

2222
@objc public func setBranchService(branchService: Any) {
@@ -355,4 +355,15 @@ public class BranchDeepLinks: CAPPlugin {
355355
}
356356
}
357357
}
358+
359+
@objc func setConsumerProtectionAttributionLevel(_ call: CAPPluginCall) {
360+
guard let level = call.getString("level") else {
361+
call.reject("Must provide a valid attribution level")
362+
return
363+
}
364+
365+
branchService.setConsumerProtectionAttributionLevel(level: level)
366+
call.resolve()
367+
}
368+
358369
}

ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def capacitor_pods
44
use_frameworks!
55
pod 'Capacitor', :path => '../node_modules/@capacitor/ios'
66
pod 'CapacitorCordova', :path => '../node_modules/@capacitor/ios'
7-
pod 'BranchSDK', '~> 3.6.5'
7+
pod 'BranchSDK', '~> 3.9.0'
88
end
99

1010
target 'Plugin' do

ios/Podfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
PODS:
2-
- BranchSDK (3.6.5)
3-
- Capacitor (6.0.0):
2+
- BranchSDK (3.9.0)
3+
- Capacitor (6.2.0):
44
- CapacitorCordova
5-
- CapacitorCordova (6.0.0)
5+
- CapacitorCordova (6.2.0)
66

77
DEPENDENCIES:
8-
- BranchSDK (~> 3.6.5)
8+
- BranchSDK (~> 3.9.0)
99
- "Capacitor (from `../node_modules/@capacitor/ios`)"
1010
- "CapacitorCordova (from `../node_modules/@capacitor/ios`)"
1111

@@ -20,10 +20,10 @@ EXTERNAL SOURCES:
2020
:path: "../node_modules/@capacitor/ios"
2121

2222
SPEC CHECKSUMS:
23-
BranchSDK: ef7d89062afb08b20f65d5b1633b215ee77ab77f
24-
Capacitor: 559d073c4ca6c27f8e7002c807eea94c3ba435a9
25-
CapacitorCordova: 8c4bfdf69368512e85b1d8b724dd7546abeb30af
23+
BranchSDK: caa0aad74d39bcd08573661d13ae0821feecdada
24+
Capacitor: 1f3c7b9802d958cd8c4eb63895fff85dff2e1eea
25+
CapacitorCordova: b33e7f4aa4ed105dd43283acdd940964374a87d9
2626

27-
PODFILE CHECKSUM: eacb5a70bea671c5a765cb96750ba8653a52d16b
27+
PODFILE CHECKSUM: 8997a24b5d8780d5611e0cf2d1d4aa3cf1c5d2ae
2828

29-
COCOAPODS: 1.15.2
29+
COCOAPODS: 1.16.2

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capacitor-branch-deep-links",
3-
"version": "8.3.0",
3+
"version": "8.4.0",
44
"description": "Capacitor plugin for Branch.io deep links",
55
"main": "dist/plugin.cjs.js",
66
"module": "dist/esm/index.js",
@@ -22,7 +22,7 @@
2222
"@capacitor/android": "^6.0.0",
2323
"@capacitor/cli": "^6.0.0",
2424
"@capacitor/core": "^6.0.0",
25-
"@capacitor/ios": "^6.0.0",
25+
"@capacitor/ios": "^6.2.0",
2626
"@ionic/prettier-config": "^1.0.0",
2727
"@ionic/swiftlint-config": "^1.0.0",
2828
"@rollup/plugin-node-resolve": "^8.1.0",

src/definitions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ export interface BranchInitEvent extends BranchReferringParamsResponse {}
8585

8686
export type BranchATTAuthorizationStatus = 0 | 1 | 2 | 3;
8787

88+
export type BranchConsumerProtectionAttributionLevel = 'FULL' | 'REDUCED' | 'MINIMAL' | 'NONE';
89+
8890
export interface BranchDeepLinksPlugin {
8991
addListener(
9092
eventName: 'init',
@@ -118,4 +120,5 @@ export interface BranchDeepLinksPlugin {
118120
getLatestReferringParams(): Promise<BranchReferringParamsResponse>;
119121
getFirstReferringParams(): Promise<BranchReferringParamsResponse>;
120122
setDMAParamsForEEA: (options: BranchDMAParams) => void;
123+
setConsumerProtectionAttributionLevel(options: { level: BranchConsumerProtectionAttributionLevel }): Promise<void>;
121124
}

0 commit comments

Comments
 (0)