Skip to content

Commit

Permalink
Merge pull request #304 from RodrigoSMarques/dev
Browse files Browse the repository at this point in the history
Release 7.2.0
  • Loading branch information
RodrigoSMarques authored Mar 18, 2024
2 parents 591816e + 1de0355 commit 10b845e
Show file tree
Hide file tree
Showing 26 changed files with 134 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-apk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Java
uses: actions/[email protected]
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
Expand All @@ -44,4 +44,4 @@ jobs:
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
timeout-minutes: 1
4 changes: 2 additions & 2 deletions .github/workflows/pr-bugfix-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: pull-request-master-to-bugfix
if: ${{ github.repository == 'RodrigoSMarques/flutter_branch_sdk' }}
uses: repo-sync/[email protected]
Expand All @@ -21,4 +21,4 @@ jobs:
pr_label: "auto-pr"
pr_draft: false
pr_allow_empty: false
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/pr-master-bugfix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: pull-request-master-to-bugfix
if: ${{ github.repository == 'RodrigoSMarques/flutter_branch_sdk' }}
uses: repo-sync/[email protected]
Expand All @@ -21,4 +21,4 @@ jobs:
pr_label: "auto-pr"
pr_draft: false
pr_allow_empty: false
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/publish-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- name: Setup Flutter
uses: subosito/flutter-action@v2
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 7.2.0
### Features
* `showShareSheet` method will now display the native Android share sheet.
* Documentation review

### Dependencies Update
* Updated dependency `js`. From version 0.6.7 to 7.0.0

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

## 7.1.0
### Features
* New Methods:
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Branch.io helps mobile apps grow with deep links that power referral systems, sh

Supports Android, iOS and Web.

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

Implemented functions in plugin:
Expand Down Expand Up @@ -45,28 +45,28 @@ For details see:
## Configure Platform Project
### Android Integration

Follow the steps:
Follow only the steps:

* [Configure App](https://help.branch.io/developers-hub/docs/android-basic-integration#4-configure-app)
* [Configure ProGuard](https://help.branch.io/developers-hub/docs/android-basic-integration#7-configure-proguard)

-
**Note**: It is not necessary to perform the Branch Android SDK installation steps. The plugin performs these steps.

### iOS Integration
Follow the steps:
Follow only the steps:

* [Configure bundle identifier](https://help.branch.io/developers-hub/docs/ios-basic-integration#2-configure-bundle-identifier)
* [Configure associated domains](https://help.branch.io/developers-hub/docs/ios-basic-integration#3-configure-associated-domains)
* [Configure Info.plist](https://help.branch.io/developers-hub/docs/ios-basic-integration#4-configure-infoplist)

**Note**: It is not necessary to perform the Branch iOS SDK installation steps. The plugin performs these steps.

#### NativeLink™ Deferred Deep Linking
Use iOS pasteboard to enable deferred deep linking via Branch NativeLink™, which enables 100% matching on iOS through Installs.

Follow the steps on the [page](https://help.branch.io/developers-hub/docs/ios-advanced-features#nativelink-deferred-deep-linking), session _**NativeLink™ Deferred Deep Linking**_,

Note: Code implementation in Swift is not necessary. The plugin already implements the code, requiring only configuration on the Dashboard.

-
**Note**: Code implementation in Swift is not necessary. The plugin already implements the code, requiring only configuration on the Dashboard.

### Web Integration

Expand Down Expand Up @@ -624,6 +624,10 @@ In response to the European Union's enactment of the Digital Markets Act (DMA),

The `setDMAParamsForEEA` method takes 3 parameters:

```dart
FlutterBranchSdk.setDMAParamsForEEA(eeaRegion: true, adPersonalizationConsent: false, adUserDataUsageConsent: false);
```

Parameter Name | Type | Description | When `true`| When `false`
|---|---|---|---|---|
eeaRegion | Boolean | Whether European regulations, including the DMA, apply to this user and conversion | User is `included` in European Union regulations. For example, if the user is located within the EEA, they are within the scope of DMA | User is considered `excluded` from European Union regulations
Expand Down
6 changes: 3 additions & 3 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.0'
classpath 'com.android.tools.build:gradle:7.3.1'
}
}

Expand Down Expand Up @@ -50,9 +50,9 @@ android {
}

dependencies {
implementation 'io.branch.sdk.android:library:5.9.+'
implementation 'io.branch.sdk.android:library:5.10.+'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'androidx.lifecycle:lifecycle-runtime:2.7.0'
implementation 'androidx.browser:browser:1.7.0'
implementation 'androidx.browser:browser:1.8.0'
implementation "store.galaxy.samsung.installreferrer:samsung_galaxystore_install_referrer:4.0.0"
}
7 changes: 7 additions & 0 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.rsmarques.flutter_branch_sdk">
<uses-permission android:name="android.permission.INTERNET" />
<application>
<receiver android:name="io.branch.receivers.SharingBroadcastReceiver" android:exported="true">
<intent-filter>
<action android:name="EXTRA_CHOSEN_COMPONENT" />
</intent-filter>
</receiver>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
Expand Down Expand Up @@ -183,6 +184,9 @@ public void onActivityStarted(@NonNull Activity activity) {
Branch.expectDelayedSessionInitialization(true);
return;
}
if (this.activity != activity) {
return;
}
LogUtils.debug(DEBUG_NAME, "triggered SessionBuilder init");
Branch.sessionBuilder(activity).withCallback(branchReferralInitListener).withData(activity.getIntent().getData()).init();
}
Expand Down Expand Up @@ -499,45 +503,72 @@ private void showShareSheet(MethodCall call, final Result result) {
String messageTitle = (String) argsMap.get("messageTitle");
String sharingTitle = (String) argsMap.get("sharingTitle");
final Map<String, Object> response = new HashMap<>();
ShareSheetStyle shareSheetStyle = new ShareSheetStyle(activity, messageTitle, messageText)
.setAsFullWidthStyle(true)
.setSharingTitle(sharingTitle);
buo.showShareSheet(activity,
linkProperties,
shareSheetStyle,
new Branch.ExtendedBranchLinkShareListener() {
@Override
public void onShareLinkDialogLaunched() {
}

@Override
public void onShareLinkDialogDismissed() {
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {

@Override
public void onLinkShareResponse(String sharedLink, String sharedChannel, BranchError error) {
if (error == null) {
LogUtils.debug(DEBUG_NAME, "Branch link share: " + sharedLink);
response.put("success", Boolean.TRUE);
response.put("url", sharedLink);
} else {
response.put("success", Boolean.FALSE);
response.put("errorCode", String.valueOf(error.getErrorCode()));
response.put("errorMessage", error.getMessage());
Branch.getInstance().share(activity, buo, linkProperties, new Branch.BranchNativeLinkShareListener() {
@Override
public void onLinkShareResponse(String sharedLink, BranchError error) {
if (error == null) {
LogUtils.debug(DEBUG_NAME, "Branch link share: " + sharedLink);
response.put("success", Boolean.TRUE);
response.put("url", sharedLink);
} else {
response.put("success", Boolean.FALSE);
response.put("errorCode", String.valueOf(error.getErrorCode()));
response.put("errorMessage", error.getMessage());
}
result.success(response);
}
@Override
public void onChannelSelected(String channelName) {
LogUtils.debug(DEBUG_NAME, "Branch link share channel: " + channelName);
}
},
messageTitle,
messageText);
} else {
ShareSheetStyle shareSheetStyle = new ShareSheetStyle(activity, messageTitle, messageText)
.setAsFullWidthStyle(true)
.setSharingTitle(sharingTitle);

buo.showShareSheet(activity,
linkProperties,
shareSheetStyle,
new Branch.ExtendedBranchLinkShareListener() {
@Override
public void onShareLinkDialogLaunched() {
}

@Override
public void onShareLinkDialogDismissed() {
}
result.success(response);
}

@Override
public void onChannelSelected(String channelName) {
@Override
public void onLinkShareResponse(String sharedLink, String sharedChannel, BranchError error) {
if (error == null) {
LogUtils.debug(DEBUG_NAME, "Branch link share: " + sharedLink);
response.put("success", Boolean.TRUE);
response.put("url", sharedLink);
} else {
response.put("success", Boolean.FALSE);
response.put("errorCode", String.valueOf(error.getErrorCode()));
response.put("errorMessage", error.getMessage());
}
result.success(response);
}

}
@Override
public void onChannelSelected(String channelName) {

@Override
public boolean onChannelSelected(String channelName, BranchUniversalObject buo, LinkProperties linkProperties) {
return false;
}
});
}

@Override
public boolean onChannelSelected(String channelName, BranchUniversalObject buo, LinkProperties linkProperties) {
return false;
}
});
}
}

private void registerView(MethodCall call) {
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- BranchSDK (3.3.0)
- Flutter (1.0.0)
- flutter_branch_sdk (7.1.0):
- flutter_branch_sdk (7.2.0):
- BranchSDK (~> 3.3.0)
- Flutter

Expand All @@ -22,7 +22,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
BranchSDK: 262dbab56b767807f49f45191c8499cd9c4b4d76
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_branch_sdk: 1ca1798cfb9ff9acf11028dee0592e3fa0234649
flutter_branch_sdk: 5470831083cca70c70f337c47cd4f71d9d8d27e9

PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048

Expand Down
4 changes: 2 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class _HomePageState extends State<HomePage> {
} else {
showSnackBar(
message:
'showShareSheet Error: ${response.errorCode} - ${response.errorMessage}',
'getLastAttributed Error: ${response.errorCode} - ${response.errorMessage}',
duration: 5);
}
}
Expand Down Expand Up @@ -470,7 +470,7 @@ class _HomePageState extends State<HomePage> {
onPressed: () async {
await Clipboard.setData(ClipboardData(text: url));
if (context.mounted) {
Navigator.pop(this.context);
Navigator.pop(context);
}
},
child: const Center(child: Text('Copy link'))),
Expand Down
6 changes: 3 additions & 3 deletions 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: "7.1.0"
version: "7.2.0"
flutter_lints:
dependency: "direct dev"
description:
Expand All @@ -107,10 +107,10 @@ packages:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
version: "0.6.7"
version: "0.7.1"
leak_tracker:
dependency: transitive
description:
Expand Down
6 changes: 6 additions & 0 deletions lib/src/constants.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AppConstants {
AppConstants._internal();
static const PLUGIN_VERSION = "7.2.0";
static const MESSAGE_CHANNEL = 'flutter_branch_sdk/message';
static const EVENT_CHANNEL = 'flutter_branch_sdk/event';
}
2 changes: 1 addition & 1 deletion lib/src/flutter_branch_sdk.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of flutter_branch_sdk;
part of '../flutter_branch_sdk.dart';

class FlutterBranchSdk {
///Initialize Branch SDK
Expand Down
Loading

1 comment on commit 10b845e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.