Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 7.0.0 #250

Merged
merged 35 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2bac029
First Commit
RodrigoSMarques Nov 4, 2022
cf8931d
version 7
RodrigoSMarques Nov 5, 2022
0ec4f0f
Merge branch 'version7' into dev_version_7
RodrigoSMarques Nov 14, 2022
00edca2
Merge pull request #192 from RodrigoSMarques/dev_version_7
RodrigoSMarques Nov 14, 2022
0cbb2e4
iOS Refactor
RodrigoSMarques Nov 17, 2022
7a99b73
Merge branch 'version7' into dev_merge
RodrigoSMarques Dec 4, 2022
f5f0c20
Merge pull request #200 from RodrigoSMarques/dev_merge
RodrigoSMarques Dec 4, 2022
3708898
Update FlutterBranchSdkPlugin.java
RodrigoSMarques Dec 4, 2022
472e7cd
Merge branch 'version7' into version7_merge
RodrigoSMarques Aug 10, 2023
5da43c7
Merge pull request #215 from RodrigoSMarques/version7_merge
RodrigoSMarques Aug 10, 2023
f119b8a
Fix after merge from master
RodrigoSMarques Aug 10, 2023
db6c88d
Code Refactor
RodrigoSMarques Aug 16, 2023
01e1392
Android Fix
RodrigoSMarques Aug 29, 2023
a98f2b3
Code alignment with Branch Master
RodrigoSMarques Oct 2, 2023
e42b7b9
Docummentation updated / Android SDK updated
RodrigoSMarques Oct 2, 2023
5fc27b1
Update FlutterBranchSdkPlugin.java
RodrigoSMarques Oct 2, 2023
c2591df
Documentation update
RodrigoSMarques Oct 2, 2023
b28505b
Documentation review / SDK initialization check
RodrigoSMarques Oct 2, 2023
0a3e4fe
Update README.md
RodrigoSMarques Oct 2, 2023
9da2aa6
Code review/documentation update
RodrigoSMarques Oct 3, 2023
3a7e340
Remove Deprecated Methods / Facebook App Install Ads on iOS
RodrigoSMarques Oct 3, 2023
49dfa14
Changelog update
RodrigoSMarques Oct 4, 2023
0575f57
Update README.md
RodrigoSMarques Oct 4, 2023
98ab0a8
Support for setting customer_event_alias for BranchEven
RodrigoSMarques Oct 6, 2023
c748b8d
Minor code adjustments and changelog update
RodrigoSMarques Oct 7, 2023
375a173
Release 7.0.0-beta.3
RodrigoSMarques Oct 11, 2023
7ad9589
Update README.md
RodrigoSMarques Oct 12, 2023
67451ee
Release 7.0.0
RodrigoSMarques Nov 2, 2023
644fc0c
Update CHANGELOG.md
RodrigoSMarques Nov 2, 2023
71a9831
Merge branch 'master' into version7
RodrigoSMarques Nov 3, 2023
3b870eb
Update pubspec.lock
RodrigoSMarques Nov 3, 2023
3d512c7
Merge branch 'version7' of https://github.com/RodrigoSMarques/flutter…
RodrigoSMarques Nov 3, 2023
e289648
Update FlutterBranchSdkInit.java
RodrigoSMarques Nov 3, 2023
7a018f7
Update FlutterBranchSdkInit.java
RodrigoSMarques Nov 3, 2023
04b75af
Update flutter_branch_sdk_method_channel.dart
RodrigoSMarques Nov 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## 7.0.0
⚠️ This is a major release which contains breaking API changes.
### BREAKING CHANGE

* Minimum required Dart SDK version to 2.18 (Flutter 3.3.0)
* Xcode 15 is the min version
* iOS 12 is the min version

#### SDK Initialization Required
* Use `FlutterBranchSdk.init()` method to initialize the SDK.

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

```dart
await FlutterBranchSdk.init(
useTestKey: false, enableLogging: false, disableTracking: false);
```

Check additional instructions in the README

#### Deprecated / Removed

* `FlutterBranchSdk.initSession()`. Use `FlutterBranchSdk.listSession()`.
* Removed `setIOSSKAdNetworkMaxTime` method
* Removed Facebook App Install Ads on iOS

### Features

* Issue #244 - Support for setting customer_event_alias for BranchEvent
* Updated compile & target SDK to Android API 33.
* Updated example app Android compileSdkVersion to 33.

### Native SDK Updates

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

## 6.9.0
### Enhancement
* Issue #244 - Support for setting customer_event_alias for BranchEvent
Expand Down Expand Up @@ -120,9 +156,7 @@
------------

* Updated Native `Android` and `iOS` SDKs:

* Android Native SDK Update 5.1.0 - [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)

* iOS Native SDK Update 1.41.0 - [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)

## 4.0.0
Expand Down
140 changes: 46 additions & 94 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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.7.+ [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
* iOS - Branch SDK Version >= 2.2.+ [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)
* iOS - Branch SDK Version >= 3.0.+ [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)

Implemented functions in plugin:

Expand Down Expand Up @@ -44,18 +44,26 @@ For details see:
### Android Integration

Follow the steps on the page [https://help.branch.io/developers-hub/docs/android-basic-integration#configure-app](https://help.branch.io/developers-hub/docs/android-basic-integration#configure-app), session _**Configure app**_:

* Add Branch to your `AndroidManifest.xml`

-

### iOS Integration
Follow the steps on the page [https://help.branch.io/developers-hub/docs/ios-basic-integration#configure-bundle-identifier](https://help.branch.io/developers-hub/docs/ios-basic-integration#configure-bundle-identifier), from session ```Configure bundle identifier```:

* Configure bundle identifier
* Configure associated domains
* Configure entitlements
* Configure Info.plist
* Confirm app prefix

> Note: In `Info.plist` not add `branch_key` `live` and `test` at the same time.<br />
Use only `branch_key` and update as needed.
#### 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.

-

### Web Integration

Expand All @@ -64,10 +72,10 @@ You need add Branch Javascript in your `web\index.html` at the top of your `<bod
```javascript
<script>
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode autoAppIndex banner closeBanner closeJourney creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setBranchViewData setIdentity track validateCode trackCommerceEvent logEvent disableTracking".split(" "), 0);
branch.init('key_live_YOUR_KEY_GOES_HERE');
branch.init('key_live_or_test_YOUR_KEY_GOES_HERE');
</script>
```
Change `key_live_YOUR_KEY_GOES_HERE` to match your [Branch Dashboard](https://dashboard.branch.io/account-settings/app)
Change `key_live_or_test_YOUR_KEY_GOES_HERE ` to match your [Branch Dashboard](https://dashboard.branch.io/account-settings/app)

If `branch.init()` fails, all subsequent Branch methods will fail.

Expand Down Expand Up @@ -108,7 +116,7 @@ Full example `index.html`:
<body>
<script>
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode autoAppIndex banner closeBanner closeJourney creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setBranchViewData setIdentity track validateCode trackCommerceEvent logEvent disableTracking".split(" "), 0);
branch.init('key_live_YOUR_KEY_GOES_HERE');
branch.init('key_live_or_test_YOUR_KEY_GOES_HERE');
</script>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
Expand All @@ -131,6 +139,31 @@ To use the plugin, add `flutter_branch_sdk` as a [dependency in your pubspec.yam

## How to use

### Initializing

To initialize Branch:

```dart
import 'package:flutter_branch_sdk/flutter_branch_sdk.dart';

await FlutterBranchSdk.init(
useTestKey: false, enableLogging: false, disableTracking: false);
```

The optional parameters are:

- *useTestKey* : Sets `true` to use the test `key_test_....` .Default value: false
- *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

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

To guarantee the success of this function, ensure you've called the below in the app's main function

```dart
WidgetsFlutterBinding.ensureInitialized();
```

### Test Branch Integration
Test your Branch Integration by calling:

Expand Down Expand Up @@ -182,14 +215,14 @@ Make sure to comment out or remove `validateSDKIntegration` in your production b
To listen to the clicks on the deep link and retrieve the data it is necessary to add the code below:

```dart
StreamSubscription<Map> streamSubscription = FlutterBranchSdk.initSession().listen((data) {
StreamSubscription<Map> streamSubscription = FlutterBranchSdk.listSession().listen((data) {
if (data.containsKey("+clicked_branch_link") &&
data["+clicked_branch_link"] == true) {
//Link clicked. Add logic to get link data
print('Custom string: ${data["custom_string"]}');
}
}, onError: (error) {
print('InitSesseion error: ${error.toString()}');
print('listSession error: ${error.toString()}');
});
```

Expand All @@ -202,7 +235,10 @@ If you ever want to access the original session params (the parameters passed in
Map<dynamic, dynamic> params = await FlutterBranchSdk.getFirstReferringParams();
```

*Note: You must call this method on `iOS` to obtain installation data if the return of the `FlutterBranchSdk.listSession()` function is {+is_first_session: true, +clicked_branch_link: false}*

### Retrieve session (install or open) parameters

These session parameters will be available at any point later on with this command. If no parameters are available then Branch will return an empty dictionary. This refreshes with every new session (app installs AND app opens).

```dart
Expand Down Expand Up @@ -510,13 +546,6 @@ Add key value pairs to all requests
FlutterBranchSdk.setRequestMetadata(requestMetadataKey, requestMetadataValue);
```

### Set time window (in Hours) for SKAdNetwork callouts (iOS only)
By default, Branch limits calls to SKAdNetwork to within 72 hours after first install.

```dart
FlutterBranchSdk.setIOSSKAdNetworkMaxTime(24);
```

### iOS 14+ App Tracking Transparency
Starting with iOS 14.5, iPadOS 14.5, and tvOS 14.5, you’ll need to receive the user’s permission through the AppTrackingTransparency framework to track them or access their device’s advertising identifier. Tracking refers to the act of linking user or device data collected from your app with user or device data collected from other companies’ apps, websites, or offline properties for targeted advertising or advertising measurement purposes. Tracking also refers to sharing user or device data with data brokers.

Expand Down Expand Up @@ -580,83 +609,6 @@ print(status);

See: [https://developer.apple.com/documentation/adsupport/asidentifiermanager/1614151-advertisingidentifier](https://developer.apple.com/documentation/adsupport/asidentifiermanager/1614151-advertisingidentifier)


### Enable Logging
Use the Branch test key instead of the live key.

Logging is enabled by default in debug mode and disabled in release mode.

To enable/disable logging update `INFO.PLIST` on `iOS` or `AndroidManifest.xml` on Android:

For `iOS` add to `INFO.PLIST`:

To disable:

```swift
<key>branch_enable_log</key>
<false/>
```

To enable:

```swift
<key>branch_enable_log</key>
<true/>
```

For `Android` add to `AndroidManifest.xml`:

To disable:

```java
<meta-data android:name="branch_enable_log"
android:value="false" />
```

To enable:

```java
<meta-data android:name="branch_enable_log"
android:value="true" />
```

### Facebook App Install Ads

Branch links can be used together with Facebook App Install Campaign ads, allowing you to track ad-driven installs on the Branch dashboard and deep link those new users directly to content the first time they open your app.

Follow the instructions on the link
<a href="https://help.branch.io/using-branch/docs/facebook-app-install-ads" target="_blank">https://help.branch.io/using-branch/docs/facebook-app-install-ads</a>.



To read Facebook App Install deep links update `INFO.PLIST` on `iOS` or `AndroidManifest.xml` on `Android` as in the example:

For `iOS` add to `INFO.PLIST`:

```swift
<key>branch_enable_facebook_ads</key>
<true/>
```
** Deprecated on version 6.8.0 **
For `Android` add to `AndroidManifest.xml`:

```java
<meta-data android:name="branch_enable_facebook_ads"
android:value="true" />
```

Follow the instructions to install Facebook Android / iOS SDK:

`iOS`:

<a href="https://developers.facebook.com/docs/ios/use-cocoapods" target="_blank">https://developers.facebook.com/docs/ios/use-cocoapods</a>

`Android`:

<a href="https://developers.facebook.com/docs/android/getting-started" target="_blank">https://developers.facebook.com/docs/android/getting-started</a>



# Getting Started
See the `example` directory for a complete sample app using Branch SDK.

Expand Down
15 changes: 13 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
group 'br.com.rsmarques.flutter_branch_sdk'
version '1.0'

def getPackageVersion() {
def props = new Properties()
file('../pubspec.yaml').withInputStream { props.load(it) }
println props.getProperty("version")
props.getProperty("version")
}

buildscript {
repositories {
google()
Expand All @@ -22,10 +29,14 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
//compileSdkVersion 31
defaultConfig {
minSdkVersion 21
compileSdk 31
compileSdk 33
buildConfigField("String", "FBRANCH_VERSION", "\"${getPackageVersion()}\"")
}

buildFeatures {
buildConfig = true
}

compileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public class FlutterBranchSdkInit {
private static final String DEBUG_NAME = "FlutterBranchSDK";
private static final String PLUGIN_NAME = "Flutter";
private static final String PLUGIN_VERSION = "6.9.0";
private static final String PLUGIN_VERSION = "7.0.0";

public static void init(Context context) {
ApplicationInfoHelper applicationInfoHelper = new ApplicationInfoHelper(context);
Expand All @@ -21,7 +21,6 @@ public static void init(Context context) {
}

// Branch object initialization
Branch.registerPlugin(PLUGIN_NAME, PLUGIN_VERSION);
Branch.getAutoInstance(context);
}
}
Loading