Skip to content

Commit a496428

Browse files
Merge pull request #435 from RodrigoSMarques/dev
Release 8.5.0
2 parents 56b4b28 + 4840634 commit a496428

File tree

15 files changed

+74
-85
lines changed

15 files changed

+74
-85
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
## 8.5.0
2+
### 🔧 Native SDK Updates
3+
* Updated included iOS SDK to 3.12.0 - [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)
4+
* Updated included Branch Android SDK to 5.18.0 - [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
5+
16
## 8.4.1
27
### 🐛 Bug Fixes
38
* Fix issue #423: setRequestMetadata doesn't populate the key value pairs in the event request as expected
49

510
## 8.4.0
6-
### Native SDK Updates
711
### 🔧 Native SDK Updates
812
* Updated included iOS SDK to 3.9.0 - [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)
913

README.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Branch.io helps mobile apps grow with deep links that power referral systems, sh
1010

1111
Supports Android, iOS and Web.
1212

13-
* Android - Branch SDK Version >= 5.15.0 [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
14-
* iOS - Branch SDK Version >= 3.9.0 [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)
13+
* Android - Branch SDK Version >= 5.18.0 [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
14+
* iOS - Branch SDK Version >= 3.12.0 [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)
1515

1616
Implemented functions in plugin:
1717

@@ -43,8 +43,30 @@ For details see:
4343
* [Android - only section: **Configure Branch Dashboard**](https://help.branch.io/developers-hub/docs/android-basic-integration#1-configure-branch-dashboard)
4444

4545
## Configure Platform Project
46-
### Android Integration
46+
### Disable default Flutter Deep Linking (Android / iOS)
47+
48+
**Flutter version 3.27** has a [_breaking change_](https://docs.google.com/document/d/1TUhaEhNdi2BUgKWQFEbOzJgmUAlLJwIAhnFfZraKgQs/edit?tab=t.0) that alters the behavior of the Deep link default flag.
49+
50+
You must manually set the value to **FALSE** in the project, according to the instructions below.
51+
52+
#### iOS
53+
1. Navigate to **ios/Runner/Info.plist** file.
54+
2. Add the following in `<dict>` chapter:
4755

56+
```xml
57+
<key>FlutterDeepLinkingEnabled</key>
58+
<false/>
59+
```
60+
61+
#### Android
62+
1. Navigate to **android/app/src/main/AndroidManifest.xml** file.
63+
2. Add the following metadata tag and intent filter inside the tag with `.MainActivity`
64+
65+
```xml
66+
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
67+
```
68+
69+
### Android Integration
4870
Follow only the steps:
4971

5072
* [Configure App](https://help.branch.io/developers-hub/docs/android-basic-integration#4-configure-app)
@@ -79,32 +101,7 @@ If you want to disable NativeLink™ Deferred Deep Linking, follow the instructi
79101
<true/>
80102
```
81103

82-
### Change Flutter Deep link flag (Android / iOS)
83-
84-
**Flutter version 3.27** has a [_breaking change_](https://docs.google.com/document/d/1TUhaEhNdi2BUgKWQFEbOzJgmUAlLJwIAhnFfZraKgQs/edit?tab=t.0) that alters the behavior of the Deep link default flag.
85-
86-
You must manually set the value to **FALSE** in the project, according to the instructions below.
87-
88-
#### iOS
89-
90-
1. Navigate to **ios/Runner/Info.plist** file.
91-
2. Add the following in `<dict>` chapter:
92-
93-
```xml
94-
<key>FlutterDeepLinkingEnabled</key>
95-
<false/>
96-
```
97-
#### Android
98-
99-
1. Navigate to **android/app/src/main/AndroidManifest.xml** file.
100-
2. Add the following metadata tag and intent filter inside the tag with `.MainActivity`
101-
102-
```xml
103-
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
104-
```
105-
106104
### Web Integration
107-
108105
You need add Branch Javascript in your `web\index.html` at the top of your `<body>` tag, to be able to use this package.
109106

110107
```javascript

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ android {
5050
}
5151

5252
dependencies {
53-
implementation 'io.branch.sdk.android:library:5.15.+'
53+
implementation 'io.branch.sdk.android:library:5.18.+'
5454
implementation 'com.google.android.gms:play-services-ads-identifier:18.2.0'
5555
implementation 'androidx.lifecycle:lifecycle-runtime:2.8.7'
5656
implementation 'androidx.browser:browser:1.8.0'

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

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import android.os.Looper;
1111

1212
import androidx.annotation.NonNull;
13-
import androidx.annotation.Nullable;
1413

1514
import org.json.JSONException;
1615
import org.json.JSONObject;
@@ -56,8 +55,8 @@ public class FlutterBranchSdkPlugin implements FlutterPlugin, MethodCallHandler,
5655
private final JSONObject requestMetadata = new JSONObject();
5756
private final JSONObject facebookParameters = new JSONObject();
5857
private final JSONObject snapParameters = new JSONObject();
59-
private final ArrayList<String> preInstallParameters = new ArrayList<String>();
60-
private final ArrayList<String> campaingParameters = new ArrayList<String>();
58+
private final ArrayList<String> preInstallParameters = new ArrayList<>();
59+
private final ArrayList<String> campaingParameters = new ArrayList<>();
6160
private Activity activity;
6261
private Context context;
6362
private ActivityPluginBinding activityPluginBinding;
@@ -412,9 +411,9 @@ private void setupBranch(MethodCall call, final Result result) {
412411
}
413412

414413
if (requestMetadata.length() > 0) {
415-
Iterator keys = requestMetadata.keys();
414+
Iterator<String> keys = requestMetadata.keys();
416415
while (keys.hasNext()) {
417-
String key = (String) keys.next();
416+
String key = keys.next();
418417
try {
419418
Branch.getInstance().setRequestMetadata(key, requestMetadata.getString(key));
420419
} catch (JSONException e) {
@@ -423,9 +422,9 @@ private void setupBranch(MethodCall call, final Result result) {
423422
}
424423
}
425424
if (facebookParameters.length() > 0) {
426-
Iterator keys = facebookParameters.keys();
425+
Iterator<String> keys = facebookParameters.keys();
427426
while (keys.hasNext()) {
428-
String key = (String) keys.next();
427+
String key = keys.next();
429428
try {
430429
Branch.getInstance().addFacebookPartnerParameterWithName(key, facebookParameters.getString(key));
431430
} catch (JSONException e) {
@@ -434,9 +433,9 @@ private void setupBranch(MethodCall call, final Result result) {
434433
}
435434
}
436435
if (snapParameters.length() > 0) {
437-
Iterator keys = snapParameters.keys();
436+
Iterator<String> keys = snapParameters.keys();
438437
while (keys.hasNext()) {
439-
String key = (String) keys.next();
438+
String key = keys.next();
440439
try {
441440
Branch.getInstance().addSnapPartnerParameterWithName(key, snapParameters.getString(key));
442441
} catch (JSONException e) {
@@ -599,33 +598,11 @@ public void run() {
599598

600599
private void listOnSearch(MethodCall call, Result result) {
601600
LogUtils.debug(DEBUG_NAME, "triggered listOnSearch");
602-
if (!(call.arguments instanceof Map)) {
603-
throw new IllegalArgumentException("Map argument expected");
604-
}
605-
HashMap<String, Object> argsMap = (HashMap<String, Object>) call.arguments;
606-
BranchUniversalObject buo = branchSdkHelper.convertToBUO((HashMap<String, Object>) argsMap.get("buo"));
607-
if (argsMap.containsKey("lp")) {
608-
LinkProperties linkProperties = branchSdkHelper.convertToLinkProperties((HashMap<String, Object>) argsMap.get("lp"));
609-
//buo.listOnGoogleSearch(context, linkProperties);
610-
} else {
611-
//buo.listOnGoogleSearch(context);
612-
}
613601
result.success(Boolean.TRUE);
614602
}
615603

616604
private void removeFromSearch(MethodCall call, Result result) {
617605
LogUtils.debug(DEBUG_NAME, "triggered removeFromSearch");
618-
if (!(call.arguments instanceof Map)) {
619-
throw new IllegalArgumentException("Map argument expected");
620-
}
621-
HashMap<String, Object> argsMap = (HashMap<String, Object>) call.arguments;
622-
BranchUniversalObject buo = branchSdkHelper.convertToBUO((HashMap<String, Object>) argsMap.get("buo"));
623-
if (argsMap.containsKey("lp")) {
624-
LinkProperties linkProperties = branchSdkHelper.convertToLinkProperties((HashMap<String, Object>) argsMap.get("lp"));
625-
//buo.removeFromLocalIndexing(context, linkProperties);
626-
} else {
627-
//buo.removeFromLocalIndexing(context);
628-
}
629606
result.success(Boolean.TRUE);
630607
}
631608

@@ -825,7 +802,7 @@ public void onDataFetched(JSONObject jsonObject, BranchError error) {
825802
jo.put("latd", jsonObject);
826803
response.put("data", branchSdkHelper.paramsToMap(jo));
827804
} catch (JSONException e) {
828-
e.printStackTrace();
805+
LogUtils.debug(DEBUG_NAME, e.getLocalizedMessage());
829806
}
830807
} else {
831808
response.put("success", Boolean.FALSE);
@@ -848,7 +825,7 @@ public void onDataFetched(JSONObject jsonObject, BranchError error) {
848825
jo.put("latd", jsonObject);
849826
response.put("data", branchSdkHelper.paramsToMap(jo));
850827
} catch (JSONException e) {
851-
e.printStackTrace();
828+
LogUtils.debug(DEBUG_NAME, e.getLocalizedMessage());
852829
}
853830
} else {
854831
response.put("success", Boolean.FALSE);
@@ -922,6 +899,7 @@ private void addFacebookPartnerParameter(MethodCall call) {
922899
try {
923900
facebookParameters.put(key, value);
924901
} catch (JSONException error) {
902+
LogUtils.debug(DEBUG_NAME, error.getLocalizedMessage());
925903
}
926904
}
927905
new Handler(Looper.getMainLooper()).post(new Runnable() {
@@ -987,6 +965,7 @@ private void addSnapPartnerParameter(MethodCall call) {
987965
try {
988966
snapParameters.put(key, value);
989967
} catch (JSONException error) {
968+
LogUtils.debug(DEBUG_NAME, error.getLocalizedMessage());
990969
}
991970
}
992971

example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
buildConfiguration = "Debug"
4545
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4646
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4748
shouldUseLaunchSchemeArgsEnv = "YES">
4849
<MacroExpansion>
4950
<BuildableReference
@@ -61,6 +62,7 @@
6162
buildConfiguration = "Debug"
6263
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
6364
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
65+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
6466
launchStyle = "0"
6567
useCustomWorkingDirectory = "NO"
6668
ignoresPersistentStateOnLaunch = "NO"

example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/home_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ class _HomePageState extends State<HomePage> {
385385

386386
void showGeneratedLink(BuildContext context, String url) async {
387387
initDeepLinkData();
388-
FlutterBranchSdk.setRequestMetadata('key1_1', 'value1');
389-
FlutterBranchSdk.setRequestMetadata('key2_1', 'value2');
388+
//FlutterBranchSdk.setRequestMetadata('key1_1', 'value1');
389+
//FlutterBranchSdk.setRequestMetadata('key2_1', 'value2');
390390
showModalBottomSheet(
391391
isDismissible: true,
392392
isScrollControlled: true,

example/lib/main.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,16 @@ void main() async {
3030
FlutterBranchSdk.setRequestMetadata('key1', 'value1');
3131
FlqutterBranchSdk.setRequestMetadata('key2', 'value2');
3232
*/
33-
//await FlutterBranchSdk.requestTrackingAuthorization();
3433

3534
await FlutterBranchSdk.init(enableLogging: true, branchAttributionLevel: BranchAttributionLevel.FULL);
3635
FlutterBranchSdk.setConsumerProtectionAttributionLevel(BranchAttributionLevel.FULL);
36+
37+
/*
38+
AppTrackingStatus status = await FlutterBranchSdk.requestTrackingAuthorization();
39+
if (status == AppTrackingStatus.notSupported) {
40+
debugPrint('not supported');
41+
}
42+
FlutterBranchSdk.disableTracking(true);
43+
*/
3744
runApp(const MyApp());
3845
}

example/pubspec.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
8+
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "2.12.0"
11+
version: "2.13.0"
1212
boolean_selector:
1313
dependency: transitive
1414
description:
@@ -61,10 +61,10 @@ packages:
6161
dependency: transitive
6262
description:
6363
name: fake_async
64-
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
64+
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
6565
url: "https://pub.dev"
6666
source: hosted
67-
version: "1.3.2"
67+
version: "1.3.3"
6868
fixnum:
6969
dependency: transitive
7070
description:
@@ -84,7 +84,7 @@ packages:
8484
path: ".."
8585
relative: true
8686
source: path
87-
version: "8.4.0"
87+
version: "8.5.0"
8888
flutter_lints:
8989
dependency: "direct dev"
9090
description:
@@ -115,10 +115,10 @@ packages:
115115
dependency: transitive
116116
description:
117117
name: leak_tracker
118-
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
118+
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
119119
url: "https://pub.dev"
120120
source: hosted
121-
version: "10.0.8"
121+
version: "10.0.9"
122122
leak_tracker_flutter_testing:
123123
dependency: transitive
124124
description:
@@ -272,10 +272,10 @@ packages:
272272
dependency: transitive
273273
description:
274274
name: vm_service
275-
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
275+
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
276276
url: "https://pub.dev"
277277
source: hosted
278-
version: "14.3.1"
278+
version: "15.0.0"
279279
sdks:
280280
dart: ">=3.7.0-0 <4.0.0"
281281
flutter: ">=3.27.0"

ios/flutter_branch_sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Flutter Plugin for create deep link using Brach SDK (https://branch.io). This pl
2020
s.source = { :path => '.' }
2121
s.source_files = 'flutter_branch_sdk/sources/flutter_branch_sdk/**/*.swift'
2222
s.dependency 'Flutter'
23-
s.dependency 'BranchSDK', '~> 3.9.0'
23+
s.dependency 'BranchSDK', '~> 3.12.0'
2424
s.platform = :ios, '12.0'
2525
# Flutter.framework does not contain a i386 slice.
2626
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }

ios/flutter_branch_sdk/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ios/flutter_branch_sdk/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let package = Package(
1212
.library(name: "flutter-branch-sdk", targets: ["flutter_branch_sdk"])
1313
],
1414
dependencies: [
15-
.package(url: "https://github.com/BranchMetrics/ios-branch-sdk-spm", "3.9.0"..."3.10.0")
15+
.package(url: "https://github.com/BranchMetrics/ios-branch-sdk-spm", "3.12.0"..."3.13.0")
1616
],
1717
targets: [
1818
.target(

ios/flutter_branch_sdk/sources/flutter_branch_sdk/FlutterBranchSdkPlugin.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let MESSAGE_CHANNEL = "flutter_branch_sdk/message";
1010
let EVENT_CHANNEL = "flutter_branch_sdk/event";
1111
let ERROR_CODE = "FLUTTER_BRANCH_SDK_ERROR";
1212
let PLUGIN_NAME = "Flutter";
13-
let PLUGIN_VERSION = "8.4.1";
13+
let PLUGIN_VERSION = "8.5.0";
1414
let COCOA_POD_NAME = "org.cocoapods.flutter-branch-sdk";
1515

1616
public class FlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStreamHandler {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
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.4.1
3+
version: 8.5.0
44
repository: https://github.com/RodrigoSMarques/flutter_branch_sdk
55

66
environment:

0 commit comments

Comments
 (0)