Skip to content

Commit e015812

Browse files
Merge pull request #404 from RodrigoSMarques/dev
Release 8.3.1
2 parents e45821b + a0805d2 commit e015812

File tree

10 files changed

+121
-121
lines changed

10 files changed

+121
-121
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 8.3.1
2+
### ⚠️ BREAKING CHANGE
3+
* Minimum required Dart SDK version 3.3.0 (Flutter 3.19.0 - 15/02/2024)
4+
5+
### 🎉 Features
6+
* Revised documentation including section to change **Flutter Deep link flag**
7+
* New option in INFO.PLIST (`branch_disable_nativelink`) that allows disable NativeLink™ Deferred Deep Linking
8+
19
## 8.3.0
210
### ⚠️ BREAKING CHANGE
311
* Minimum required Dart SDK version 3.3.0 (Flutter 3.19.0 - 15/02/2024)

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,41 @@ Follow the steps on the [page](https://help.branch.io/developers-hub/docs/ios-ad
6868

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

71+
#### Disable NativeLink™ Deferred Deep Linking
72+
If you want to disable NativeLink™ Deferred Deep Linking, follow the instructions below:
73+
74+
1. Navigate to **ios/Runner/Info.plist** file.
75+
2. Add the following in `<dict>` chapter:
76+
77+
```xml
78+
<key>branch_disable_nativelink</key>
79+
<true/>
80+
```
81+
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+
71106
### Web Integration
72107

73108
You need add Branch Javascript in your `web\index.html` at the top of your `<body>` tag, to be able to use this package.
@@ -744,7 +779,6 @@ Practices to avoid:
744779
* [Answering the Google Play Store Privacy Questions](https://help.branch.io/using-branch/docs/answering-the-google-play-store-privacy-questions)
745780

746781

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

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
<data android:scheme="https" android:host="flutterbranchsdk-alternate.test-app.link" />
4242
<data android:scheme="https" android:host="flutterbranchsdk.test-app.link" />
4343
</intent-filter>
44+
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
4445
</activity>
4546
<!-- Don't delete the meta-data below.
4647
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->

example/ios/Podfile.lock

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
PODS:
22
- Flutter (1.0.0)
33

4-
- flutter_branch_sdk (8.3.0):
5-
- BranchSDK (~> 3.7.0)
6-
- Flutter
7-
84
DEPENDENCIES:
95
- Flutter (from `Flutter`)
106

@@ -15,8 +11,6 @@ EXTERNAL SOURCES:
1511
SPEC CHECKSUMS:
1612
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
1713

18-
flutter_branch_sdk: 5a91002c028d3157155e34ee934c0b216bebef1d
19-
2014
PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048
2115

2216
COCOAPODS: 1.16.2

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 60;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -49,6 +49,9 @@
4949
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5050
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
5151
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
52+
AB1D5F54BAB544003F61E88D /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
53+
EA0E68F4285672D0306D38B1 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
54+
F19994400E82ADF824F766FF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
5255
/* End PBXFileReference section */
5356

5457
/* Begin PBXFrameworksBuildPhase section */
@@ -75,6 +78,9 @@
7578
83204363E71EE2485FF0D939 /* Pods */ = {
7679
isa = PBXGroup;
7780
children = (
81+
EA0E68F4285672D0306D38B1 /* Pods-Runner.debug.xcconfig */,
82+
F19994400E82ADF824F766FF /* Pods-Runner.release.xcconfig */,
83+
AB1D5F54BAB544003F61E88D /* Pods-Runner.profile.xcconfig */,
7884
);
7985
path = Pods;
8086
sourceTree = "<group>";
@@ -179,7 +185,7 @@
179185
);
180186
mainGroup = 97C146E51CF9000F007C117D;
181187
packageReferences = (
182-
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
188+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
183189
);
184190
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
185191
projectDirPath = "";
@@ -556,7 +562,7 @@
556562
/* End XCConfigurationList section */
557563

558564
/* Begin XCLocalSwiftPackageReference section */
559-
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
565+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
560566
isa = XCLocalSwiftPackageReference;
561567
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
562568
};

example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@
7474
<string>flutterbranchsdk-alternate.test-app.link</string>
7575
<string>flutterbranchsdk.test-app.link</string>
7676
</array>
77+
<key>branch_disable_nativelink</key>
78+
<false/>
79+
<key>FlutterDeepLinkingEnabled</key>
80+
<false/>
7781
<key>UIApplicationSupportsIndirectInputEvents</key>
7882
<true/>
7983
</dict>

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.0"
87+
version: "8.3.1"
8888
flutter_lints:
8989
dependency: "direct dev"
9090
description:

ios/flutter_branch_sdk/Package.swift

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,6 @@
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
5-
/*
6-
import Foundation
7-
8-
9-
enum ConfigurationError: Error {
10-
case fileNotFound(String)
11-
case parsingError(String)
12-
case invalidFormat(String)
13-
}
14-
15-
let branchDirectory = String(URL(string: #file)!.deletingLastPathComponent().absoluteString.dropLast())
16-
17-
func loadPubspecVersions() throws -> String {
18-
let pubspecPath = NSString.path(withComponents: [branchDirectory,"..","..","pubspec.yaml"])
19-
do {
20-
let yamlString = try String(contentsOfFile: pubspecPath, encoding: .utf8)
21-
let lines = yamlString.split(separator: "\\\\r\\\\n")
22-
23-
guard let packageVersionLine = lines.first(where: { $0.starts(with: "version:") }) else {
24-
throw ConfigurationError.invalidFormat("No package version line found in pubspec.yaml: \(lines.count)")
25-
}
26-
var packageVersion = packageVersionLine.split(separator: ":")[1]
27-
.trimmingCharacters(in: .whitespaces)
28-
.replacingOccurrences(of: "+", with: "-")
29-
packageVersion = packageVersion.replacingOccurrences(of: "^", with: "")
30-
return packageVersion
31-
} catch {
32-
throw ConfigurationError.fileNotFound("Error loading or parsing pubspec.yaml \(pubspecPath) :\n Error: \(error)")
33-
}
34-
}
35-
36-
let library_version: String
37-
38-
do {
39-
library_version = try loadPubspecVersions()
40-
} catch {
41-
fatalError("Failed to load configuration: \(error)")
42-
}
43-
*/
445

456
let package = Package(
467
name: "flutter_branch_sdk",
@@ -59,9 +20,6 @@ let package = Package(
5920
dependencies: [
6021
.product(name: "BranchSDK", package: "ios-branch-sdk-spm"),
6122
],
62-
//cSettings: [
63-
// .define("LIBRARY_VERSION", to: "\"\(library_version)\""),
64-
//],
6523
linkerSettings: [
6624
.linkedFramework("CoreServices"),
6725
.linkedFramework("SystemConfiguration"),
Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ 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.3.0";
13+
let PLUGIN_VERSION = "8.3.1";
1414
let COCOA_POD_NAME = "org.cocoapods.flutter-branch-sdk";
1515

16-
public class SwiftFlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStreamHandler {
16+
public class FlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStreamHandler {
1717
var eventSink: FlutterEventSink?
1818
var initialParams : [String: Any]? = nil
1919
var initialError : NSError? = nil
@@ -29,7 +29,7 @@ public class SwiftFlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStream
2929
// Plugin registry
3030
// --------------------------------------------------------------------------------------------
3131
public static func register(with registrar: FlutterPluginRegistrar) {
32-
let instance = SwiftFlutterBranchSdkPlugin()
32+
let instance = FlutterBranchSdkPlugin()
3333

3434
methodChannel = FlutterMethodChannel(name: MESSAGE_CHANNEL, binaryMessenger: registrar.messenger())
3535
eventChannel = FlutterEventChannel(name: EVENT_CHANNEL, binaryMessenger: registrar.messenger())
@@ -38,30 +38,24 @@ public class SwiftFlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStream
3838
registrar.addApplicationDelegate(instance)
3939
registrar.addMethodCallDelegate(instance, channel: methodChannel!)
4040
}
41-
42-
func getPluginVersion() -> String {
43-
44-
var pluginVersion : String = ""
45-
#if SWIFT_PACKAGE
46-
pluginVersion = PLUGIN_VERSION;
47-
#else
48-
if let version = Bundle(identifier: COCOA_POD_NAME)?.infoDictionary?["CFBundleShortVersionString"] as? String {
49-
pluginVersion = version;
50-
}
51-
#endif
5241

53-
#if DEBUG
54-
print("Plugin: \(PLUGIN_NAME) - \(pluginVersion)")
55-
#endif
56-
return pluginVersion
57-
}
58-
5942
public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [AnyHashable : Any] = [:]) -> Bool {
6043

61-
Branch.getInstance().registerPluginName(PLUGIN_NAME, version: getPluginVersion())
44+
Branch.getInstance().registerPluginName(PLUGIN_NAME, version: PLUGIN_VERSION)
45+
46+
let disable_nativelink : Bool = {
47+
guard let value = Bundle.main.object(forInfoDictionaryKey: "branch_disable_nativelink") as? Bool else {
48+
return false
49+
}
50+
return value
51+
}()
52+
53+
print("Branch Disable NativeLink: \(String(describing:disable_nativelink))");
6254

63-
if #available(iOS 15.0, *) {
64-
Branch.getInstance().checkPasteboardOnInstall()
55+
if !disable_nativelink {
56+
if #available(iOS 15.0, *) {
57+
Branch.getInstance().checkPasteboardOnInstall()
58+
}
6559
}
6660

6761
Branch.getInstance().initSession(launchOptions: launchOptions) { (params, error) in

pubspec.yaml

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
1-
name: flutter_branch_sdk
2-
description: Flutter Plugin for create deep link using Brach SDK (https://branch.io). This plugin provides a cross-platform (iOS, Android, Web).
3-
repository: https://github.com/RodrigoSMarques/flutter_branch_sdk
4-
version: 8.3.0
5-
environment:
6-
sdk: ">=3.3.0 <4.0.0"
7-
flutter: ">=3.19.0"
8-
9-
dependencies:
10-
flutter:
11-
sdk: flutter
12-
flutter_web_plugins:
13-
sdk: flutter
14-
plugin_platform_interface: ^2.1.8
15-
16-
dev_dependencies:
17-
flutter_test:
18-
sdk: flutter
19-
flutter_lints: ^5.0.0
20-
21-
# For information on the generic Dart part of this file, see the
22-
# following page: https://dart.dev/tools/pub/pubspec
23-
24-
# The following section is specific to Flutter packages.
25-
flutter:
26-
# This section identifies this Flutter project as a plugin project.
27-
# The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.)
28-
# which should be registered in the plugin registry. This is required for
29-
# using method channels.
30-
# The Android 'package' specifies package in which the registered class is.
31-
# This is required for using method channels on Android.
32-
# The 'ffiPlugin' specifies that native code should be built and bundled.
33-
# This is required for using `dart:ffi`.
34-
# All these are used by the tooling to maintain consistency when
35-
# adding or updating assets for this project.
36-
plugin:
37-
platforms:
38-
android:
39-
package: br.com.rsmarques.flutter_branch_sdk
40-
pluginClass: FlutterBranchSdkPlugin
41-
ios:
42-
pluginClass: SwiftFlutterBranchSdkPlugin
43-
web:
44-
pluginClass: FlutterBranchSdkWeb
45-
fileName: src/flutter_branch_sdk_web.dart
1+
name: flutter_branch_sdk
2+
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
4+
repository: https://github.com/RodrigoSMarques/flutter_branch_sdk
5+
6+
environment:
7+
sdk: ">=3.3.0 <4.0.0"
8+
flutter: '>=3.19.0'
9+
10+
dependencies:
11+
flutter:
12+
sdk: flutter
13+
flutter_web_plugins:
14+
sdk: flutter
15+
plugin_platform_interface: ^2.1.8
16+
17+
dev_dependencies:
18+
flutter_test:
19+
sdk: flutter
20+
flutter_lints: ^5.0.0
21+
22+
# For information on the generic Dart part of this file, see the
23+
# following page: https://dart.dev/tools/pub/pubspec
24+
25+
# The following section is specific to Flutter packages.
26+
flutter:
27+
# This section identifies this Flutter project as a plugin project.
28+
# The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.)
29+
# which should be registered in the plugin registry. This is required for
30+
# using method channels.
31+
# The Android 'package' specifies package in which the registered class is.
32+
# This is required for using method channels on Android.
33+
# The 'ffiPlugin' specifies that native code should be built and bundled.
34+
# This is required for using `dart:ffi`.
35+
# All these are used by the tooling to maintain consistency when
36+
# adding or updating assets for this project.
37+
plugin:
38+
platforms:
39+
android:
40+
package: br.com.rsmarques.flutter_branch_sdk
41+
pluginClass: FlutterBranchSdkPlugin
42+
ios:
43+
pluginClass: FlutterBranchSdkPlugin
44+
web:
45+
pluginClass: FlutterBranchSdkWeb
46+
fileName: src/flutter_branch_sdk_web.dart

0 commit comments

Comments
 (0)