Skip to content

Commit f272fba

Browse files
Merge pull request #348 from RodrigoSMarques/dev
Release 8.0.4
2 parents 8a7ef32 + 1562a72 commit f272fba

File tree

6 files changed

+31
-20
lines changed

6 files changed

+31
-20
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 8.0.4
2+
### ⚠️ BREAKING CHANGE
3+
This is a major release which contains breaking API changes.
4+
#### ⚠️ SDK Initialization Changed
5+
* `useTestKey` parameter is no longer supported at `FlutterBranchSdk.init()`.
6+
7+
Check the instructions in `README.MD` on how to activate the `key_test_`.
8+
9+
### 🐛 Bug Fixes
10+
* Fix issue #347: ios plugin v8.0.3 crashes when no url is returned
11+
* Fix issue #338: Changing the return value in didFinishLaunchingWithOptions crashes the application from SDK version above 8.0.0
12+
113
## 8.0.3
214
### ⚠️ BREAKING CHANGE
315
This is a major release which contains breaking API changes.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ private void getShortUrl(MethodCall call, final Result result) {
466466
@Override
467467
public void onLinkCreate(String url, BranchError error) {
468468

469-
if ((error == null) || (error != null && url != null)) {
469+
if ((error == null && url != null) || (error != null && url != null)) {
470470
LogUtils.debug(DEBUG_NAME, "Branch link to share: " + url);
471471
response.put("success", true);
472472
response.put("url", url);

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

ios/Classes/SwiftFlutterBranchSdkPlugin.swift

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ public class SwiftFlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStream
4747
}
4848

4949
public func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [AnyHashable : Any] = [:]) -> Bool {
50-
branch = Branch.getInstance();
51-
branch!.registerPluginName(PLUGIN_NAME, version: getPluginVersion())
50+
Branch.getInstance().registerPluginName(PLUGIN_NAME, version: getPluginVersion())
5251

5352
if #available(iOS 15.0, *) {
54-
branch!.checkPasteboardOnInstall()
53+
Branch.getInstance().checkPasteboardOnInstall()
5554
}
5655

57-
branch!.initSession(launchOptions: launchOptions) { (params, error) in
56+
Branch.getInstance().initSession(launchOptions: launchOptions) { (params, error) in
5857
if error == nil {
5958
print("Branch InitSession params: \(String(describing: params as? [String: Any]))")
6059
guard let _ = self.eventSink else {
@@ -78,22 +77,22 @@ public class SwiftFlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStream
7877
}
7978

8079
public func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
81-
let branchHandled = branch!.application(app, open: url, options: options)
80+
let branchHandled = Branch.getInstance().application(app, open: url, options: options)
8281
return branchHandled
8382
}
8483

8584
public func application(_ app: UIApplication, open url: URL, sourceApplication: String, annotation: Any) -> Bool {
86-
let branchHandled = branch!.application(app, open: url, sourceApplication: sourceApplication, annotation: annotation)
85+
let branchHandled = Branch.getInstance().application(app, open: url, sourceApplication: sourceApplication, annotation: annotation)
8786
return branchHandled
8887
}
8988

9089
public func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]) -> Void) -> Bool {
91-
let handledByBranch = branch!.continue(userActivity)
90+
let handledByBranch = Branch.getInstance().continue(userActivity)
9291
return handledByBranch
9392
}
9493

9594
public func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
96-
branch!.handlePushNotification(userInfo)
95+
Branch.getInstance().handlePushNotification(userInfo)
9796
}
9897

9998
//---------------------------------------------------------------------------------------------
@@ -260,17 +259,17 @@ public class SwiftFlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStream
260259

261260
if (!requestMetadata.isEmpty) {
262261
for param in requestMetadata {
263-
branch!.setRequestMetadataKey(param.key, value: param.value)
262+
Branch.getInstance().setRequestMetadataKey(param.key, value: param.value)
264263
}
265264
}
266265
if (!snapParameters.isEmpty) {
267266
for param in snapParameters {
268-
branch!.addSnapPartnerParameter(withName: param.key, value: param.value)
267+
Branch.getInstance().addSnapPartnerParameter(withName: param.key, value: param.value)
269268
}
270269
}
271270
if (!facebookParameters.isEmpty) {
272271
for param in facebookParameters {
273-
branch!.addFacebookPartnerParameter(withName: param.key, value: param.value)
272+
Branch.getInstance().addFacebookPartnerParameter(withName: param.key, value: param.value)
274273
}
275274
}
276275
isInitialized = true
@@ -286,7 +285,7 @@ public class SwiftFlutterBranchSdkPlugin: NSObject, FlutterPlugin, FlutterStream
286285

287286
let response : NSMutableDictionary! = [:]
288287
buo?.getShortUrl(with: lp!) { (url, error) in
289-
if ((error == nil) || (error != nil && url != nil)) {
288+
if ((error == nil && url != nil) || (error != nil && url != nil)) {
290289
NSLog("getShortUrl: %@", url!)
291290
response["success"] = NSNumber(value: true)
292291
response["url"] = url!

pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ packages:
5858
dependency: "direct dev"
5959
description:
6060
name: flutter_lints
61-
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
61+
sha256: "3f41d009ba7172d5ff9be5f6e6e6abb4300e263aab8866d2a0842ed2a70f8f0c"
6262
url: "https://pub.dev"
6363
source: hosted
64-
version: "3.0.2"
64+
version: "4.0.0"
6565
flutter_test:
6666
dependency: "direct dev"
6767
description: flutter
@@ -108,10 +108,10 @@ packages:
108108
dependency: transitive
109109
description:
110110
name: lints
111-
sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
111+
sha256: "976c774dd944a42e83e2467f4cc670daef7eed6295b10b36ae8c85bcbf828235"
112112
url: "https://pub.dev"
113113
source: hosted
114-
version: "3.0.0"
114+
version: "4.0.0"
115115
matcher:
116116
dependency: transitive
117117
description:

pubspec.yaml

Lines changed: 2 additions & 2 deletions
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.0.3
3+
version: 8.0.4
44
homepage: https://github.com/RodrigoSMarques/flutter_branch_sdk
55

66
environment:
@@ -18,7 +18,7 @@ dependencies:
1818
dev_dependencies:
1919
flutter_test:
2020
sdk: flutter
21-
flutter_lints: ^3.0.2
21+
flutter_lints: ^4.0.0
2222

2323
# For information on the generic Dart part of this file, see the
2424
# following page: https://dart.dev/tools/pub/pubspec

0 commit comments

Comments
 (0)