Skip to content

Commit

Permalink
Merge pull request #400 from RodrigoSMarques/dev
Browse files Browse the repository at this point in the history
Release 8.3.0
  • Loading branch information
RodrigoSMarques authored Dec 20, 2024
2 parents 3b80703 + 0b3c25a commit ec0fe56
Show file tree
Hide file tree
Showing 48 changed files with 695 additions and 303 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
/ios/flutter_branch_sdk/.build
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 8.3.0
### ⚠️ BREAKING CHANGE
* Minimum required Dart SDK version 3.3.0 (Flutter 3.19.0 - 15/02/2024)

### 🎉 Features
* New Methods:
- `setConsumerProtectionAttributionLevel` - Sets the consumer protection attribution level. Read Branch documentation for details:
* [Introducing Consumer Protection Preference Levels] (https://help.branch.io/using-branch/changelog/introducing-consumer-protection-preference-levels)
* [Consumer Protection Preferences](https://help.branch.io/developers-hub/docs/consumer-protection-preferences)

#### Deprecated / Removed
* `FlutterBranchSdk.disableTracking()`. Use `FlutterBranchSdk.setConsumerProtectionAttributionLevel()`.
* Removed `initSession` method.

### Native SDK Updates
### 🔧 Native SDK Updates
* Updated included iOS SDK to 3.7.0 - [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)
* Updated included Branch Android SDK to 5.15.0 - [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)

## 8.2.0
### ⚠️ BREAKING CHANGE
* Minimum required Dart SDK version 3.3.0 (Flutter 3.19.0 - 15/02/2024)
Expand Down Expand Up @@ -78,7 +97,6 @@ This is a major release which contains breaking API changes.
### 🔧 Native SDK Updates

* Updated included iOS SDK to 3.4.3 - [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)

* Updated included Branch Android SDK to 5.12.0 - [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)


Expand Down
73 changes: 65 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Branch.io helps mobile apps grow with deep links that power referral systems, sh

Supports Android, iOS and Web.

* Android - Branch SDK Version >= 5.12.0 [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
* iOS - Branch SDK Version >= 3.6.0 [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)
* Android - Branch SDK Version >= 5.15.0 [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
* iOS - Branch SDK Version >= 3.7.0 [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)

Implemented functions in plugin:

Expand Down Expand Up @@ -159,7 +159,16 @@ await FlutterBranchSdk.init(enableLogging: false, disableTracking: false);
The optional parameters are:

- *enableLogging* : Sets `true` turn on debug logging. Default value: false
- *disableTracking*: Sets `true` to disable tracking in Branch SDK for GDPR compliant on start. Default value: false
- *disableTracking*: Sets `true` to disable tracking in Branch SDK for GDPR compliant on start. Default value: false
- *branchAttributionLevel* : The level of attribution data to collect.
- `BranchAttributionLevel.FULL`: Full Attribution (Default)
- `BranchAttributionLevel.REDUCE`: Reduced Attribution (Non-Ads + Privacy Frameworks)
- `BranchAttributionLevel.MINIMAL`: Minimal Attribution - Analytics Only
- `BranchAttributionLevel.NONE`: No Attribution - No Analytics (GDPR, CCPA)

Read Branch documentation for details: [Introducing Consumer Protection Preference Levels](https://help.branch.io/using-branch/changelog/introducing-consumer-protection-preference-levels) and [Consumer Protection Preferences](https://help.branch.io/developers-hub/docs/consumer-protection-preferences)

*Note: The `disableTracking` parameter is deprecated and should no longer be used. Please use `branchAttributionLevel` to control tracking behavior.*

Initialization must be called from `main` or at any time, for example after getting consent for GPDR.

Expand Down Expand Up @@ -531,7 +540,7 @@ FlutterBranchSdk.logout();
bool isUserIdentified = await FlutterBranchSdk.isUserIdentified();
```

### Enable or Disable User Tracking
### Enable or Disable User Tracking (Deprecated. Read Consumer Preference Levels)
If you need to comply with a user's request to not be tracked for GDPR purposes, or otherwise determine that a user should not be tracked, utilize this field to prevent Branch from sending network requests. This setting can also be enabled across all users for a particular link, or across your Branch links.

```dart
Expand All @@ -544,6 +553,35 @@ You can choose to call this throughout the lifecycle of the app. Once called, ne

More information [here](https://help.branch.io/developers-hub/docs/honoring-opt-out-of-processing-requests)

### Consumer Preference Levels
Sets the consumer protection attribution level:

* `BranchAttributionLevel.FULL`: Full Attribution (Default)

```dart
FlutterBranchSdk.setConsumerProtectionAttributionLevel(BranchAttributionLevel.FULL);
```
* `BranchAttributionLevel.REDUCE`: Reduced Attribution (Non-Ads + Privacy Frameworks)

```dart
FlutterBranchSdk.setConsumerProtectionAttributionLevel(BranchAttributionLevel.REDUCED);
```
* `BranchAttributionLevel.MINIMAL`: Minimal Attribution - Analytics

```dart
FlutterBranchSdk.setConsumerProtectionAttributionLevel(BranchAttributionLevel.MINIMAL);
```
* `BranchAttributionLevel.NONE`: No Attribution - No Analytics (GDPR, CCPA)

```dart
FlutterBranchSdk.setConsumerProtectionAttributionLevel(BranchAttributionLevel.NONE);
```
Read Branch documentation for details:

- [Introducing Consumer Protection Preference Levels](https://help.branch.io/using-branch/changelog/introducing-consumer-protection-preference-levels)
- [Consumer Protection Preferences](https://help.branch.io/developers-hub/docs/consumer-protection-preferences)


### Set Request Meta data
Add key value pairs to all requests

Expand Down Expand Up @@ -634,6 +672,7 @@ adUserDataUsageConsent | Boolean | Whether end user has granted or denied consen

When parameters are successfully set using `setDMAParamsForEEA`, they will be sent along with every future request to the following Branch endpoint.


# Configuring the project to use Branch Test Key
## Android

Expand Down Expand Up @@ -694,11 +733,29 @@ Practices to avoid:
3. Don't wait to initialize the object until you conveniently need a link.
4. Don't create many objects at once and register views in a for loop.

# Deep links with Short Links
More information [here](https://help.branch.io/using-branch/docs/creating-a-deep-link#short-links)
# Create Deep Links
* Deep links with [Short Links](https://help.branch.io/using-branch/docs/creating-a-deep-link#short-links)
* Deep links with [Long links](https://help.branch.io/using-branch/docs/creating-a-deep-link#long-links)

# Data Privacy
* [Introducing Consumer Protection Preference Levels] (https://help.branch.io/using-branch/changelog/introducing-consumer-protection-preference-levels)
* [Consumer Protection Preferences](https://help.branch.io/developers-hub/docs/consumer-protection-preferences)
* [Answering the App Store Connect Privacy Questions](https://help.branch.io/using-branch/docs/answering-the-app-store-connect-privacy-questions)
* [Answering the Google Play Store Privacy Questions](https://help.branch.io/using-branch/docs/answering-the-google-play-store-privacy-questions)



# SDK FAQs
* [Android SDK FAQs](https://help.branch.io/faq/docs/android-sdk)
* [iOS SDK FAQs](https://help.branch.io/faq/docs/ios-sdk)

# Testing
* [Android Testing](https://help.branch.io/developers-hub/docs/android-testing)
* [iOS Testing](https://help.branch.io/developers-hub/docs/ios-testing)

# Deep links with Long links
More information [here](https://help.branch.io/using-branch/docs/creating-a-deep-link#long-links)
# Troubleshooting
* [Android Troubleshooting](https://help.branch.io/developers-hub/docs/android-troubleshooting)
* [iOS Troubleshooting](https://help.branch.io/developers-hub/docs/ios-troubleshooting)

# Branch Documentation
Read the iOS or Android documentation for all Branch object parameters:
Expand Down
4 changes: 3 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ include: package:flutter_lints/flutter.yaml
# https://dart.dev/guides/language/analysis-options
linter:
rules:
constant_identifier_names: false
constant_identifier_names: false
# public_member_api_docs: true
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
15 changes: 8 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.android.tools.build:gradle:8.1.4'
}
}

Expand All @@ -38,22 +38,23 @@ android {
buildConfig = true
}

compileSdk 35

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

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

dependencies {
implementation 'io.branch.sdk.android:library:5.12.+'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'androidx.lifecycle:lifecycle-runtime:2.7.0'
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 @@ -26,6 +26,7 @@
import io.branch.referral.Branch;
import io.branch.referral.BranchError;
import io.branch.referral.BranchLogger;
import io.branch.referral.Defines;
import io.branch.referral.QRCode.BranchQRCode;
import io.branch.referral.ServerRequestGetLATD;
import io.branch.referral.util.BranchEvent;
Expand Down Expand Up @@ -279,7 +280,7 @@ public boolean onNewIntent(@NonNull Intent intent) {
return false;
}
this.activity.setIntent(intent);
if (intent.hasExtra("branch_force_new_session") && intent.getBooleanExtra("branch_force_new_session",false)) {
if (intent.hasExtra("branch_force_new_session") && intent.getBooleanExtra("branch_force_new_session", false)) {
Branch.sessionBuilder(this.activity).withCallback(branchReferralInitListener).reInit();
LogUtils.debug(DEBUG_NAME, "triggered SessionBuilder reInit");
}
Expand Down Expand Up @@ -383,6 +384,9 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result rawResult) {
case "setDMAParamsForEEA":
setDMAParamsForEEA(call);
break;
case "setConsumerProtectionAttributionLevel":
setConsumerProtectionAttributionLevel(call);
break;
default:
result.notImplemented();
break;
Expand Down Expand Up @@ -450,20 +454,26 @@ private void setupBranch(MethodCall call, final Result result) {
Branch.getAutoInstance(context).setPreinstallCampaign(campaingParameters.get(i));
}
}

if ((Boolean) argsMap.get("disableTracking")) {
Branch.getInstance().disableTracking(true);
} else {
Branch.getInstance().disableTracking(false);
}

final String branchAttributionLevelString = call.argument("branchAttributionLevel");
if (branchAttributionLevelString != null && !branchAttributionLevelString.isEmpty()) {
Branch.getInstance().setConsumerProtectionAttributionLevel(Defines.BranchAttributionLevel.valueOf(branchAttributionLevelString));
}

LogUtils.debug(DEBUG_NAME, "notifyNativeToInit()");
Branch.notifyNativeToInit();
isInitialized = true;
result.success(Boolean.TRUE);
}

private void validateSDKIntegration() {
IntegrationValidator.validate(activity);
IntegrationValidator.validate(this.activity);
}

private void getShortUrl(MethodCall call, final Result result) {
Expand Down Expand Up @@ -520,6 +530,7 @@ public void onLinkShareResponse(String sharedLink, BranchError error) {
}
result.success(response);
}

@Override
public void onChannelSelected(String channelName) {
LogUtils.debug(DEBUG_NAME, "Branch link share channel: " + channelName);
Expand Down Expand Up @@ -996,7 +1007,16 @@ private void setDMAParamsForEEA(MethodCall call) {
final boolean adPersonalizationConsent = Boolean.TRUE.equals(call.argument("adPersonalizationConsent"));
final boolean adUserDataUsageConsent = Boolean.TRUE.equals(call.argument("adUserDataUsageConsent"));

Branch.getInstance().setDMAParamsForEEA(eeaRegion,adPersonalizationConsent,adUserDataUsageConsent);
Branch.getInstance().setDMAParamsForEEA(eeaRegion, adPersonalizationConsent, adUserDataUsageConsent);
}

private void setConsumerProtectionAttributionLevel(MethodCall call) {
LogUtils.debug(DEBUG_NAME, "triggered setConsumerProtectionAttributionLevel");
if (!(call.arguments instanceof Map)) {
throw new IllegalArgumentException("Map argument expected");
}
final String branchAttributionLevelString = call.argument("branchAttributionLevel");
Branch.getInstance().setConsumerProtectionAttributionLevel(Defines.BranchAttributionLevel.valueOf(branchAttributionLevelString));
}
}

Expand Down
Binary file modified assets/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
3 changes: 2 additions & 1 deletion example/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ linter:
# producing the lint.
rules:
avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule


# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
6 changes: 3 additions & 3 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility 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"
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.android.tools.build:gradle:8.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
13 changes: 7 additions & 6 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
19 changes: 6 additions & 13 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
PODS:
- BranchSDK (3.6.0)
- Flutter (1.0.0)
- flutter_branch_sdk (8.2.0):
- BranchSDK (~> 3.6.0)

- flutter_branch_sdk (8.3.0):
- BranchSDK (~> 3.7.0)
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_branch_sdk (from `.symlinks/plugins/flutter_branch_sdk/ios`)

SPEC REPOS:
trunk:
- BranchSDK

EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_branch_sdk:
:path: ".symlinks/plugins/flutter_branch_sdk/ios"

SPEC CHECKSUMS:
BranchSDK: 40ff1a13b1dc0729f79a9aae230418d25bf739a8
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_branch_sdk: b3763b3d53a7cfbc87c51136bed66fcdc282bdf5

flutter_branch_sdk: 5a91002c028d3157155e34ee934c0b216bebef1d

PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
Loading

0 comments on commit ec0fe56

Please sign in to comment.