Skip to content

Commit c66e539

Browse files
[SDK-2445] Update Branch native SDKs and Capacitor core to 6.0.0 (#154)
* feat!: upgrade to Capacitor v6 Just ran `npx @capacitor/plugin-migration-v5-to-v6@latest` * Updated to the latest capacitor and native SDK versions * Update listener to promise * Updated changelog and updated pods * Updated version to 8.0.0 --------- Co-authored-by: tafelnl <35837839+tafelnl@users.noreply.github.com>
1 parent 57c92fa commit c66e539

File tree

10 files changed

+58
-28
lines changed

10 files changed

+58
-28
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.0.0
4+
5+
- Updated the `addListener` method to return a `Promise<PluginListenerHandle>`.
6+
- Updates the core capacitor plugin to 6.0.0
7+
- Branch Android SDK bumped to 5.12.0
8+
- Branch iOS SDK bumped to 3.4.3
9+
310
- 7.1.0
411

512
- Added new method, setDMAParamsForEEA(), for setting DMA compliance parameters.

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ buildscript {
1919
mavenCentral()
2020
}
2121
dependencies {
22-
classpath 'com.android.tools.build:gradle:8.0.2'
22+
classpath 'com.android.tools.build:gradle:8.2.1'
2323
}
2424
}
2525

2626
apply plugin: 'com.android.library'
2727

2828
android {
2929
namespace "co.boundstate.capacitorbranchdeeplinks"
30-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
30+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
3131
buildFeatures {
3232
buildConfig = true
3333
}
3434
defaultConfig {
3535
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
36-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
36+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
3737
versionCode 1
3838
versionName "1.0"
3939
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -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.9.0'
69+
api 'io.branch.sdk.android:library:5.12.0'
7070
testImplementation "junit:junit:$junitVersion"
7171
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
7272
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
1.73 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

android/gradlew

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ done
8585
APP_BASE_NAME=${0##*/}
8686
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90-
9188
# Use the maximum available, or set MAX_FD != -1 to use that value.
9289
MAX_FD=maximum
9390

@@ -133,10 +130,13 @@ location of your Java installation."
133130
fi
134131
else
135132
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
133+
if ! command -v java >/dev/null 2>&1
134+
then
135+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137136
138137
Please set the JAVA_HOME variable in your environment to match the
139138
location of your Java installation."
139+
fi
140140
fi
141141

142142
# Increase the maximum file descriptors if we can.
@@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
197197
done
198198
fi
199199

200+
201+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203+
200204
# Collect all arguments for the java command;
201205
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202206
# shell script including quotes and variable substitutions, so put them in

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.2.0'
7+
pod 'BranchSDK', '~> 3.4.3'
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.0.1)
3-
- Capacitor (5.5.1):
2+
- BranchSDK (3.4.3)
3+
- Capacitor (6.0.0):
44
- CapacitorCordova
5-
- CapacitorCordova (5.5.1)
5+
- CapacitorCordova (6.0.0)
66

77
DEPENDENCIES:
8-
- BranchSDK (~> 3.0.1)
8+
- BranchSDK (~> 3.4.3)
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: e268bcf41469051c9e83efcd6fd85d0ba91d1d0f
24-
Capacitor: 9da0a2415e3b6098511f8b5ffdb578d91ee79f8f
25-
CapacitorCordova: e128cc7688c070ca0bfa439898a5f609da8dbcfe
23+
BranchSDK: 078e92df232a7cc0a8d900287d1e57057a2e2997
24+
Capacitor: 559d073c4ca6c27f8e7002c807eea94c3ba435a9
25+
CapacitorCordova: 8c4bfdf69368512e85b1d8b724dd7546abeb30af
2626

27-
PODFILE CHECKSUM: c730e0536dc486077a354a5b012e11d630c85889
27+
PODFILE CHECKSUM: 9848c096c118889beda819a4d6984c25fcf3f9bc
2828

29-
COCOAPODS: 1.12.1
29+
COCOAPODS: 1.15.2

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capacitor-branch-deep-links",
3-
"version": "7.1.0",
3+
"version": "8.0.0",
44
"description": "Capacitor plugin for Branch.io deep links",
55
"main": "dist/plugin.cjs.js",
66
"module": "dist/esm/index.js",
@@ -19,10 +19,10 @@
1919
"author": "Bound State Software <info@boundstatesoftware.com>",
2020
"license": "MIT",
2121
"devDependencies": {
22-
"@capacitor/android": "^5.0.0",
23-
"@capacitor/cli": "^5.0.0",
24-
"@capacitor/core": "^5.0.0",
25-
"@capacitor/ios": "^5.0.0",
22+
"@capacitor/android": "^6.0.0",
23+
"@capacitor/cli": "^6.0.0",
24+
"@capacitor/core": "^6.0.0",
25+
"@capacitor/ios": "^6.0.0",
2626
"@ionic/prettier-config": "^1.0.0",
2727
"@ionic/swiftlint-config": "^1.0.0",
2828
"@rollup/plugin-node-resolve": "^8.1.0",
@@ -36,7 +36,7 @@
3636
"typescript": "^5.1.3"
3737
},
3838
"peerDependencies": {
39-
"@capacitor/core": "^5.0.0"
39+
"@capacitor/core": "^6.0.0"
4040
},
4141
"files": [
4242
"src/",

src/definitions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ export interface BranchDeepLinksPlugin {
8989
addListener(
9090
eventName: 'init',
9191
listenerFunc: (event: BranchInitEvent) => void,
92-
): PluginListenerHandle;
92+
): Promise<PluginListenerHandle>;
9393
addListener(
9494
eventName: 'initError',
9595
listenerFunc: (error: any) => void,
96-
): PluginListenerHandle;
96+
): Promise<PluginListenerHandle>;
9797
handleUrl(options: BranchUrlParams): Promise<void>;
9898
generateShortUrl(
9999
options: BranchShortUrlParams,

src/web.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { WebPlugin } from '@capacitor/core';
1+
import { WebPlugin, PluginListenerHandle } from '@capacitor/core';
22

33
import {
44
BranchDeepLinksPlugin,
@@ -12,6 +12,7 @@ import {
1212
BranchQRCodeParams,
1313
BranchQRCodeResponse,
1414
BranchDMAParams,
15+
BranchInitEvent,
1516
} from './definitions';
1617

1718
export class BranchDeepLinksWeb
@@ -107,4 +108,21 @@ export class BranchDeepLinksWeb
107108
new Error('BranchDeepLinks does not have web implementation'),
108109
);
109110
}
111+
112+
addListener(
113+
_eventName: 'init',
114+
_listenerFunc: (event: BranchInitEvent) => void,
115+
): Promise<PluginListenerHandle>;
116+
addListener(
117+
_eventName: 'initError',
118+
_listenerFunc: (error: any) => void,
119+
): Promise<PluginListenerHandle>;
120+
addListener(
121+
_eventName: string,
122+
_listenerFunc: (event: any) => void,
123+
): Promise<PluginListenerHandle> {
124+
return Promise.reject(
125+
new Error('BranchDeepLinks does not have web implementation'),
126+
);
127+
}
110128
}

0 commit comments

Comments
 (0)