Skip to content

Commit

Permalink
Merge pull request RodrigoSMarques#413 from RodrigoSMarques/dev
Browse files Browse the repository at this point in the history
Release 8.3.2
  • Loading branch information
RodrigoSMarques authored Jan 17, 2025
2 parents e015812 + 91f2543 commit 7cd3fdd
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 77 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 8.3.2
### ⚠️ BREAKING CHANGE
* Minimum required Dart SDK version 3.3.0 (Flutter 3.19.0 - 15/02/2024)

### 🐛 Bug Fixes
* Fix issue #410: "reply already sent and a possible ANR". Tks @Junglee-Faisal

### 🎉 Features
* Migrated Gradle to declarative plugins block

## 8.3.1
### ⚠️ BREAKING CHANGE
* Minimum required Dart SDK version 3.3.0 (Flutter 3.19.0 - 15/02/2024)
Expand Down
32 changes: 16 additions & 16 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'br.com.rsmarques.flutter_branch_sdk'
version '1.0'
group = 'br.com.rsmarques.flutter_branch_sdk'
version = '1.0'

def getPackageVersion() {
def props = new Properties()
Expand All @@ -15,7 +15,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.1.4'
classpath("com.android.tools.build:gradle:8.2.2")
}
}

Expand All @@ -34,27 +34,27 @@ android {
namespace 'br.com.rsmarques.flutter_branch_sdk'
}

compileSdk 35

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

buildFeatures {
buildConfig = true
}

compileSdk 35

defaultConfig {
minSdkVersion 21
buildConfigField("String", "FBRANCH_VERSION", "\"${getPackageVersion()}\"")
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
dependencies {
implementation 'io.branch.sdk.android:library:5.15.+'
implementation 'com.google.android.gms:play-services-ads-identifier:18.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime:2.8.7'
implementation 'androidx.browser:browser:1.8.0'
implementation "store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0"
}
}

dependencies {
implementation 'io.branch.sdk.android:library:5.15.+'
implementation 'com.google.android.gms:play-services-ads-identifier:18.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime:2.8.7'
implementation 'androidx.browser:browser:1.8.0'
implementation "store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,26 @@
public class MethodResultWrapper implements MethodChannel.Result {
private final MethodChannel.Result methodResult;
private final Handler handler;
private boolean called;

MethodResultWrapper(MethodChannel.Result result) {
methodResult = result;
handler = new Handler(Looper.getMainLooper());
}

private synchronized boolean checkNotCalled() {
if (called) {
return false;
}
called = true;
return true;
}

@Override
public void success(final Object result) {
if (!checkNotCalled()) {
return;
}
handler.post(
new Runnable() {
@Override
Expand All @@ -33,6 +45,9 @@ public void run() {
@Override
public void error(
final String errorCode, final String errorMessage, final Object errorDetails) {
if (!checkNotCalled()) {
return;
}
handler.post(
new Runnable() {
@Override
Expand All @@ -48,6 +63,9 @@ public void run() {

@Override
public void notImplemented() {
if (!checkNotCalled()) {
return;
}
handler.post(
new Runnable() {
@Override
Expand Down
54 changes: 18 additions & 36 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace 'br.com.rsmarques.flutter_branch_sdk_example'
defaultConfig {
compileSdk flutter.compileSdkVersion
}
ndkVersion flutter.ndkVersion
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}


kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "br.com.rsmarques.flutter_branch_sdk_example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
multiDexEnabled true
}

Expand Down
13 changes: 0 additions & 13 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
Expand Down
30 changes: 22 additions & 8 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.2.2" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

include ":app"
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ packages:
path: ".."
relative: true
source: path
version: "8.3.1"
version: "8.3.2"
flutter_lints:
dependency: "direct dev"
description:
Expand Down
11 changes: 9 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_branch_sdk
description: "Flutter Plugin for create deep link using Brach SDK (https://branch.io). This plugin provides a cross-platform (iOS, Android, Web)."
version: 8.3.1
version: 8.3.2
repository: https://github.com/RodrigoSMarques/flutter_branch_sdk

environment:
Expand Down Expand Up @@ -43,4 +43,11 @@ flutter:
pluginClass: FlutterBranchSdkPlugin
web:
pluginClass: FlutterBranchSdkWeb
fileName: src/flutter_branch_sdk_web.dart
fileName: src/flutter_branch_sdk_web.dart

topics:
- deeplink
- app-links
- universal-links
- custom-url-schemes
- web-to-app

0 comments on commit 7cd3fdd

Please sign in to comment.