Skip to content

Commit 7cd3fdd

Browse files
Merge pull request #413 from RodrigoSMarques/dev
Release 8.3.2
2 parents e015812 + 91f2543 commit 7cd3fdd

File tree

9 files changed

+95
-77
lines changed

9 files changed

+95
-77
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 8.3.2
2+
### ⚠️ BREAKING CHANGE
3+
* Minimum required Dart SDK version 3.3.0 (Flutter 3.19.0 - 15/02/2024)
4+
5+
### 🐛 Bug Fixes
6+
* Fix issue #410: "reply already sent and a possible ANR". Tks @Junglee-Faisal
7+
8+
### 🎉 Features
9+
* Migrated Gradle to declarative plugins block
10+
111
## 8.3.1
212
### ⚠️ BREAKING CHANGE
313
* Minimum required Dart SDK version 3.3.0 (Flutter 3.19.0 - 15/02/2024)

android/build.gradle

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group 'br.com.rsmarques.flutter_branch_sdk'
2-
version '1.0'
1+
group = 'br.com.rsmarques.flutter_branch_sdk'
2+
version = '1.0'
33

44
def getPackageVersion() {
55
def props = new Properties()
@@ -15,7 +15,7 @@ buildscript {
1515
}
1616

1717
dependencies {
18-
classpath 'com.android.tools.build:gradle:8.1.4'
18+
classpath("com.android.tools.build:gradle:8.2.2")
1919
}
2020
}
2121

@@ -34,27 +34,27 @@ android {
3434
namespace 'br.com.rsmarques.flutter_branch_sdk'
3535
}
3636

37+
compileSdk 35
38+
39+
compileOptions {
40+
sourceCompatibility JavaVersion.VERSION_11
41+
targetCompatibility JavaVersion.VERSION_11
42+
}
43+
3744
buildFeatures {
3845
buildConfig = true
3946
}
40-
41-
compileSdk 35
42-
4347
defaultConfig {
4448
minSdkVersion 21
4549
buildConfigField("String", "FBRANCH_VERSION", "\"${getPackageVersion()}\"")
4650
}
4751

48-
compileOptions {
49-
sourceCompatibility JavaVersion.VERSION_11
50-
targetCompatibility JavaVersion.VERSION_11
52+
dependencies {
53+
implementation 'io.branch.sdk.android:library:5.15.+'
54+
implementation 'com.google.android.gms:play-services-ads-identifier:18.2.0'
55+
implementation 'androidx.lifecycle:lifecycle-runtime:2.8.7'
56+
implementation 'androidx.browser:browser:1.8.0'
57+
implementation "store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0"
5158
}
5259
}
5360

54-
dependencies {
55-
implementation 'io.branch.sdk.android:library:5.15.+'
56-
implementation 'com.google.android.gms:play-services-ads-identifier:18.2.0'
57-
implementation 'androidx.lifecycle:lifecycle-runtime:2.8.7'
58-
implementation 'androidx.browser:browser:1.8.0'
59-
implementation "store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0"
60-
}

android/src/main/java/br/com/rsmarques/flutter_branch_sdk/MethodResultWrapper.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,26 @@
99
public class MethodResultWrapper implements MethodChannel.Result {
1010
private final MethodChannel.Result methodResult;
1111
private final Handler handler;
12+
private boolean called;
1213

1314
MethodResultWrapper(MethodChannel.Result result) {
1415
methodResult = result;
1516
handler = new Handler(Looper.getMainLooper());
1617
}
1718

19+
private synchronized boolean checkNotCalled() {
20+
if (called) {
21+
return false;
22+
}
23+
called = true;
24+
return true;
25+
}
26+
1827
@Override
1928
public void success(final Object result) {
29+
if (!checkNotCalled()) {
30+
return;
31+
}
2032
handler.post(
2133
new Runnable() {
2234
@Override
@@ -33,6 +45,9 @@ public void run() {
3345
@Override
3446
public void error(
3547
final String errorCode, final String errorMessage, final Object errorDetails) {
48+
if (!checkNotCalled()) {
49+
return;
50+
}
3651
handler.post(
3752
new Runnable() {
3853
@Override
@@ -48,6 +63,9 @@ public void run() {
4863

4964
@Override
5065
public void notImplemented() {
66+
if (!checkNotCalled()) {
67+
return;
68+
}
5169
handler.post(
5270
new Runnable() {
5371
@Override

example/android/app/build.gradle

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,33 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
17-
}
18-
19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
226
}
237

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
288
android {
299
namespace 'br.com.rsmarques.flutter_branch_sdk_example'
30-
defaultConfig {
31-
compileSdk flutter.compileSdkVersion
32-
}
33-
ndkVersion flutter.ndkVersion
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
3412

3513
compileOptions {
3614
sourceCompatibility JavaVersion.VERSION_11
3715
targetCompatibility JavaVersion.VERSION_11
3816
}
39-
17+
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_11
20+
}
21+
4022
defaultConfig {
4123
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4224
applicationId "br.com.rsmarques.flutter_branch_sdk_example"
43-
// You can update the following values to match your application needs.
44-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
45-
minSdkVersion 21
46-
targetSdkVersion flutter.targetSdkVersion
47-
versionCode flutterVersionCode.toInteger()
48-
versionName flutterVersionName
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
4931
multiDexEnabled true
5032
}
5133

example/android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:8.2.1'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()

example/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
44
android.defaults.buildfeatures.buildconfig=true

example/android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "8.2.2" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
23+
}
24+
25+
include ":app"

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ packages:
8484
path: ".."
8585
relative: true
8686
source: path
87-
version: "8.3.1"
87+
version: "8.3.2"
8888
flutter_lints:
8989
dependency: "direct dev"
9090
description:

pubspec.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_branch_sdk
22
description: "Flutter Plugin for create deep link using Brach SDK (https://branch.io). This plugin provides a cross-platform (iOS, Android, Web)."
3-
version: 8.3.1
3+
version: 8.3.2
44
repository: https://github.com/RodrigoSMarques/flutter_branch_sdk
55

66
environment:
@@ -43,4 +43,11 @@ flutter:
4343
pluginClass: FlutterBranchSdkPlugin
4444
web:
4545
pluginClass: FlutterBranchSdkWeb
46-
fileName: src/flutter_branch_sdk_web.dart
46+
fileName: src/flutter_branch_sdk_web.dart
47+
48+
topics:
49+
- deeplink
50+
- app-links
51+
- universal-links
52+
- custom-url-schemes
53+
- web-to-app

0 commit comments

Comments
 (0)