Skip to content

Commit

Permalink
Merge pull request #235 from RodrigoSMarques/master
Browse files Browse the repository at this point in the history
PR Branch MASTER into BUGFIX
  • Loading branch information
RodrigoSMarques committed Aug 10, 2023
2 parents e1eb764 + 9aa3355 commit 2e7866a
Show file tree
Hide file tree
Showing 18 changed files with 151 additions and 148 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
cache: true
- name: Lint
run: flutter format --output=none --set-exit-if-changed lib/
run: dart format --output=none --set-exit-if-changed lib/
check-code-analysis-flutter:
name: Code analysis (flutter)
timeout-minutes: 5
Expand All @@ -40,4 +40,4 @@ jobs:
- name: Install dependencies
run: flutter pub get
- name: Analyze code
run: flutter analyze --no-fatal-infos
run: flutter analyze --no-fatal-infos
12 changes: 6 additions & 6 deletions .github/workflows/deploy-apk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-java@v1
- name: Setup Java
uses: actions/setup-java@v3.12.0
with:
java-version: "12.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
distribution: "zulu"
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
Expand All @@ -35,7 +34,8 @@ jobs:
run: chmod +x tool/build-apk.sh
- name: Install dependencies & Build apk
run: tool/build-apk.sh
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v3
with:
name: release-apk
path: ./example/build/app/outputs/apk/release/app-release.apk
path: ./example/build/app/outputs/apk/release/app-release.apk
if-no-files-found: error
26 changes: 10 additions & 16 deletions .github/workflows/publish-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,28 @@ name: Publish plugin - pub.dev

on:
push:
# branches:
# - "dev"
tags:
- 'v*'
workflow_dispatch:

jobs:
release:
publish:
permissions:
id-token: write # Required for authentication using OIDC
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- uses: dart-lang/setup-dart@v1
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
cache: true

- name: Install dependencies
run: dart pub get
- name: Generate documentation
run: dart doc
- name: Publish flutter package
uses: k-paxian/dart-package-publisher@v1.4
# uses: RodrigoSMarques/dart-package-publisher@master
with:
accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }}
refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }}
flutter: true
format: true
skipTests: true
dryRunOnly: true
# docs: true

#run: dart pub publish --dry-run
run: dart pub publish --force
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 6.7.0
* Updated Native `Android` and `iOS` SDKs:
* Android Native SDK Update 5.6.+ - [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
* iOS Native SDK Update 2.2.0 - [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)

* Removed:
- Firebase App Indexing in Android (`listOnSearch` and `removeFromSearch` return `success` but do not perform any action)
- Old Apple Search Ads APIs (parameter `branch_check_apple_ads`)

## 6.6.0
* Updated Native `Android` and `iOS` SDKs:
* Android Native SDK Update 5.4.+ - [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
Expand Down
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Branch.io helps mobile apps grow with deep links that power referral systems, sh

Supports Android, iOS and Web.

* Android - Branch SDK Version >= 5.4.+ [Android Version History](https://github.com/BranchMetrics/android-branch-deep-linking-attribution/releases)
* iOS - Branch SDK Version >= 2.1.+ [iOS Version History](https://github.com/BranchMetrics/ios-branch-deep-linking-attribution/releases)
* Android - Branch SDK Version >= 5.6.+ [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)

Implemented functions in plugin:

Expand All @@ -21,7 +21,7 @@ Enable / Disable User Tracking | X | X | X
Get First and Last Parameters | X | X | X
Generate Deep Link for Branch Universal Object (BUO)| X | X | X
Show Share Sheet for Branch Universal Object (BUO)| X | X | X
List BUO on Search / Remove BUO from Search| X | X | Not supported
List BUO on Search / Remove BUO from Search| | X |
Register view| X | X | X
Track User Actions and Events| X | X | X
Init Branch Session and Deep Link| X | X | X
Expand Down Expand Up @@ -400,8 +400,10 @@ Replace *"https://flutterbranchsdk.test-app.link/sxz79EtAPub"* with your own lin
> Handling a new deep link in your app will clear the current session data and a new referred "open" will be attributed.
### List content on Search
* For Android list BUO links in Google Search with Firebase App Indexing API and locally in Google In Apps search
* For iOs list BUO links in Spotlight
* For Android no action will be taken
* For WEB not supported


```dart
bool success = await FlutterBranchSdk.listOnSearch(buo: buo);
Expand Down Expand Up @@ -515,18 +517,6 @@ By default, Branch limits calls to SKAdNetwork to within 72 hours after first in
FlutterBranchSdk.setIOSSKAdNetworkMaxTime(24);
```

### Apple Search Ads
Branch can help track your Apple Search Ad campaigns by fetching the search ad attribution from Apple at app install.

Add KEY ```branch_check_apple_ads``` in INFO.PLIST to enable checking for Apple Search Ads before Branch initialization.

In `ios/Runner/Info.plist`, you should have something like:

```xml
<key>branch_check_apple_ads</key>
<true/>
```

### 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
22 changes: 11 additions & 11 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.android.tools.build:gradle:7.3.0'
}
}

Expand All @@ -22,23 +22,23 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 31
//compileSdkVersion 31
defaultConfig {
minSdkVersion 21
compileSdk 31
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
minSdkVersion 21
}
}

dependencies {
implementation 'io.branch.sdk.android:library:5.4.+'
implementation 'com.google.firebase:firebase-appindexing:19.0.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1+'
implementation 'androidx.browser:browser:1.4.0'
implementation 'io.branch.sdk.android:library:5.6.+'
//implementation 'com.google.firebase:firebase-appindexing:19.0.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'androidx.browser:browser:1.5.0'
implementation 'androidx.lifecycle:lifecycle-runtime:2.5.1'
implementation 'androidx.browser:browser:1.4.0'
implementation 'androidx.browser:browser:1.5.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ private void listOnSearch(MethodCall call, Result result) {
if (!(call.arguments instanceof Map)) {
throw new IllegalArgumentException("Map argument expected");
}
LogUtils.debug(DEBUG_NAME, "listOnSearch removed from Branch SDK");
result.success(Boolean.TRUE);
/*
HashMap<String, Object> argsMap = (HashMap<String, Object>) call.arguments;
BranchUniversalObject buo = branchSdkHelper.convertToBUO((HashMap<String, Object>) argsMap.get("buo"));
if (argsMap.containsKey("lp")) {
Expand All @@ -482,22 +485,27 @@ private void listOnSearch(MethodCall call, Result result) {
buo.listOnGoogleSearch(context);
}
result.success(Boolean.TRUE);
*/
}

private void removeFromSearch(MethodCall call, Result result) {
LogUtils.debug(DEBUG_NAME, "removeFromSearch call");
if (!(call.arguments instanceof Map)) {
throw new IllegalArgumentException("Map argument expected");
}
LogUtils.debug(DEBUG_NAME, "removeFromSearch removed from Branch SDK");
result.success(Boolean.TRUE);
/*
HashMap<String, Object> argsMap = (HashMap<String, Object>) call.arguments;
BranchUniversalObject buo = branchSdkHelper.convertToBUO((HashMap<String, Object>) argsMap.get("buo"));
if (argsMap.containsKey("lp")) {
LinkProperties linkProperties = branchSdkHelper.convertToLinkProperties((HashMap<String, Object>) argsMap.get("lp"));
buo.removeFromLocalIndexing(context, linkProperties);
//buo.removeFromLocalIndexing(context, linkProperties);
} else {
buo.removeFromLocalIndexing(context);
//buo.removeFromLocalIndexing(context);
}
result.success(Boolean.TRUE);
*/
}

private void trackContent(MethodCall call) {
Expand Down
5 changes: 4 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
//compileSdkVersion flutter.compileSdkVersion
defaultConfig {
compileSdk flutter.compileSdkVersion
}
ndkVersion flutter.ndkVersion

compileOptions {
Expand Down
62 changes: 31 additions & 31 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PODS:
- BranchSDK (2.1.0)
- BranchSDK (2.2.0)
- Flutter (1.0.0)
- flutter_branch_sdk (6.4.0):
- BranchSDK (~> 2.1.0)
- BranchSDK (~> 2.2.0)
- Flutter

DEPENDENCIES:
Expand All @@ -20,9 +20,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_branch_sdk/ios"

SPEC CHECKSUMS:
BranchSDK: ce28650272c658fcdb66675769e670ef83845d17
BranchSDK: 8749d10e30725d08b6c188ab90e6fd6223d204db
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_branch_sdk: cc0393df011973fe6ab0380bc54bce1a3726e8a3
flutter_branch_sdk: da3bece1a03160a8a021ef4ec3d426e89c6da169

PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d

Expand Down
1 change: 1 addition & 0 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down
13 changes: 10 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class _HomePageState extends State<HomePage> {

static const imageURL =
'https://raw.githubusercontent.com/RodrigoSMarques/flutter_branch_sdk/master/assets/branch_logo_qrcode.jpeg';

@override
void initState() {
super.initState();
Expand Down Expand Up @@ -337,7 +338,9 @@ class _HomePageState extends State<HomePage> {
BranchResponse response =
await FlutterBranchSdk.getShortUrl(buo: buo!, linkProperties: lp);
if (response.success) {
showGeneratedLink(this.context, response.result);
if (context.mounted) {
showGeneratedLink(context, response.result);
}
} else {
showSnackBar(
message: 'Error : ${response.errorCode} - ${response.errorMessage}');
Expand Down Expand Up @@ -376,7 +379,9 @@ class _HomePageState extends State<HomePage> {
backgroundColor: Colors.white,
imageFormat: BranchImageFormat.PNG));
if (responseQrCodeImage.success) {
showQrCode(this.context, responseQrCodeImage.result);
if (context.mounted) {
showQrCode(context, responseQrCodeImage.result);
}
} else {
showSnackBar(
message:
Expand Down Expand Up @@ -413,7 +418,9 @@ class _HomePageState extends State<HomePage> {
child: CustomButton(
onPressed: () async {
await Clipboard.setData(ClipboardData(text: url));
Navigator.pop(this.context);
if (context.mounted) {
Navigator.pop(this.context);
}
},
child: const Center(child: Text('Copy link'))),
),
Expand Down

0 comments on commit 2e7866a

Please sign in to comment.