Skip to content

Commit

Permalink
1.6.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Korney committed Aug 20, 2024
1 parent 6e7e21b commit 5188d35
Show file tree
Hide file tree
Showing 14 changed files with 171 additions and 57 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [1.6.20] - 2024-08-19

### Added

- iOS only api `Affise.ios.getReferrerOnServer`.
- iOS only api `Affise.ios.getReferrerOnServerValue`.

### Changed

- Api `Affise.getReferrer` to `Affise.getReferrerUrl`.
- Api `Affise.getReferrerValue` to `Affise.getReferrerUrlValue`.
- Update native iOS to [`1.6.39`](https://github.com/affise/sdk-ios/blob/1.6.39/CHANGELOG.md).
- Update native Android to [`1.6.42`](https://github.com/affise/sdk-android/blob/v1.6.42/CHANGELOG.md).

## [1.6.19] - 2024-08-01

### Fixed
Expand Down Expand Up @@ -116,6 +130,7 @@
- Api `Affise.android.getReferrer` to `Affise.getReferrer`
- Api `Affise.android.getReferrerValue` to `Affise.getReferrerValue`

[1.6.20]: https://github.com/affise/flutter-sdk/compare/1.6.19...1.6.20
[1.6.19]: https://github.com/affise/flutter-sdk/compare/1.6.18...1.6.19
[1.6.18]: https://github.com/affise/flutter-sdk/compare/1.6.17...1.6.18
[1.6.17]: https://github.com/affise/flutter-sdk/compare/1.6.16...1.6.17
Expand Down
68 changes: 51 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Package | Version |
|--------------------------|:--------------------------------------------------------:|
| `affise_attribution_lib` | [`1.6.19`](https://github.com/affise/sdk-react/releases) |
| `affise_attribution_lib` | [`1.6.20`](https://github.com/affise/sdk-react/releases) |

- [Affise Attribution Flutter Library](#affise-attribution-flutter-library)
- [Description](#description)
Expand Down Expand Up @@ -59,7 +59,9 @@
- [Is first run](#is-first-run)
- [Get referrer](#get-referrer)
- [Get referrer value](#get-referrer-value)
- [Referrer keys](#referrer-keys)
- [Get referrer on server](#get-referrer-on-server)
- [Get referrer on server parameter](#get-referrer-on-server-parameter)
- [Referrer keys](#referrer-keys)
- [Get module state](#get-module-state)
- [Platform specific](#platform-specific)
- [GDPR right to be forgotten](#gdpr-right-to-be-forgotten)
Expand Down Expand Up @@ -125,12 +127,12 @@ Example [`example/android/app/build.gradle`](example/android/app/build.gradle)
```gradle
dependencies {
// Affise modules
implementation 'com.affise:module-advertising:1.6.40'
implementation 'com.affise:module-androidid:1.6.40'
implementation 'com.affise:module-link:1.6.40'
implementation 'com.affise:module-network:1.6.40'
implementation 'com.affise:module-phone:1.6.40'
implementation 'com.affise:module-status:1.6.40'
implementation 'com.affise:module-advertising:1.6.42'
implementation 'com.affise:module-androidid:1.6.42'
implementation 'com.affise:module-link:1.6.42'
implementation 'com.affise:module-network:1.6.42'
implementation 'com.affise:module-phone:1.6.42'
implementation 'com.affise:module-status:1.6.42'
}
```

Expand All @@ -140,9 +142,9 @@ Add modules to iOS project

| Module | Version | Start |
|---------------|:------------------------------------------------------------------------------------:|----------|
| `ADVERTISING` | [`1.6.36`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` |
| `LINK` | [`1.6.36`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` |
| `STATUS` | [`1.6.36`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` |
| `ADVERTISING` | [`1.6.39`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` |
| `LINK` | [`1.6.39`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` |
| `STATUS` | [`1.6.39`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` |

Example [example/ios/Podfile](example/ios/Podfile)

Expand All @@ -151,9 +153,9 @@ target 'Runner' do
# ...

# Affise Modules
pod 'AffiseModule/Advertising', `1.6.36`
pod 'AffiseModule/Link', `1.6.36`
pod 'AffiseModule/Status', `1.6.36`
pod 'AffiseModule/Advertising', `1.6.39`
pod 'AffiseModule/Link', `1.6.39`
pod 'AffiseModule/Status', `1.6.39`
end
```

Expand Down Expand Up @@ -1057,7 +1059,7 @@ Affise.isFirstRun().then((isFirstRun) {
Use the next public method of SDK

```dart
Affise.getReferrer((value) {
Affise.getReferrerUrl((value) {
// handle referrer
});
```
Expand All @@ -1067,12 +1069,44 @@ Affise.getReferrer((value) {
Use the next public method of SDK to get referrer value by

```dart
Affise.getReferrerValue(ReferrerKey.CLICK_ID, (value) {
Affise.getReferrerUrlValue(ReferrerKey.CLICK_ID, (value) {
// handle referrer
});
```

### Referrer keys
## Get referrer on server

> `iOS Only`
> **Note**
>
> Requires [Affise Status Module](#modules) for [ios](#ios)
Use the next public method of SDK

```dart
Affise.ios.getReferrerOnServer((value) {
// handle referrer
});
```

## Get referrer on server parameter

> `iOS Only`
> **Note**
>
> Requires [Affise Status Module](#modules) for [ios](#ios)
Use the next public method of SDK to get referrer parameter by

```dart
Affise.ios.getReferrerOnServerValue(ReferrerKey.CLICK_ID, (value) {
// handle referrer value
});
```

## Referrer keys

In examples above `ReferrerKey.CLICK_ID` is used, but many others is available:

Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
group 'com.affise.attribution.affise_attribution_lib'
version '1.6.19'
version '1.6.20'

buildscript {
ext.kotlin_version = '1.7.10'
ext.affise_version = '1.6.40'
ext.affise_version = '1.6.42'
ext.agp_version = '7.2.1'

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.os.Looper
import com.affise.attribution.deeplink.toDeeplinkValue
import com.affise.attribution.internal.AffiseApiMethod
import com.affise.attribution.internal.AffiseApiWrapper
import com.affise.attribution.internal.utils.DataMapper
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
Expand Down Expand Up @@ -86,16 +87,7 @@ class AffiseAttributionLibPlugin :

val value = Uri.parse(url).toDeeplinkValue()
events?.success(
mapOf(
// TODO 1.6.39 internal utils
AffiseApiMethod.REGISTER_DEEPLINK_CALLBACK.method to mapOf(
"deeplink" to value.deeplink,
"scheme" to value.scheme,
"host" to value.host,
"path" to value.path,
"parameters" to value.parameters
)
)
DataMapper.fromDeeplinkValue(value)
)
}

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ flutter {
source '../..'
}

final affise_version = '1.6.40'
final affise_version = '1.6.42'

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

# Affise modules
pod 'AffiseModule/Advertising', '1.6.36'
pod 'AffiseModule/Status', '1.6.36'
pod 'AffiseModule/Link', '1.6.36'
pod 'AffiseModule/Advertising', '1.6.39'
pod 'AffiseModule/Status', '1.6.39'
pod 'AffiseModule/Link', '1.6.39'
end

post_install do |installer|
Expand Down
24 changes: 18 additions & 6 deletions example/lib/affise/factories/api_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,37 @@ class ApiFactory {
output?.call("Modules: $value");
});
},
"Referrer": () {
"Get Referrer Url": () {
// Get referrer https://github.com/affise/flutter-sdk#get-referrer
Affise.getReferrer((value) {
Affise.getReferrerUrl((value) {
output?.call("Referrer: $value");
});
},
"ReferrerValue": () {
"Get Referrer Url Value": () {
// Get referrer value https://github.com/affise/flutter-sdk#get-referrer-value
Affise.getReferrerValue(ReferrerKey.CLICK_ID, (value) {
Affise.getReferrerUrlValue(ReferrerKey.CLICK_ID, (value) {
output?.call("ReferrerValue: $value");
});
},
"SKAd register": () {
"iOS Get Referrer On Server": () {
// Get referrer https://github.com/affise/flutter-sdk#get-referrer-on-server
Affise.ios.getReferrerOnServer((value) {
output?.call("ReferrerOnServer: $value");
});
},
"iOS Get Referrer On Server Value": () {
// Get referrer value https://github.com/affise/flutter-sdk#get-referrer-on-server-parameter
Affise.ios.getReferrerOnServerValue(ReferrerKey.CLICK_ID, (value) {
output?.call("ReferrerOnServerValue: $value");
});
},
"iOS SKAd register": () {
// StoreKit Ad Network https://github.com/affise/flutter-sdk#storekit-ad-network
Affise.ios.registerAppForAdNetworkAttribution((error) {
output?.call("SKAd register: $error");
});
},
"SKAd update": () {
"iOS SKAd update": () {
// StoreKit Ad Network https://github.com/affise/flutter-sdk#storekit-ad-network
Affise.ios.updatePostbackConversionValue(
1, SKAdNetwork.CoarseConversionValue.medium, (error) {
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.6.19"
version: "1.6.20"
async:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion ios/affise_attribution_lib.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Affise Attribution Flutter plugin.
s.swift_version = '5.0'

s.dependency 'Flutter'
s.dependency 'AffiseInternal', '1.6.36'
s.dependency 'AffiseInternal', '1.6.39'

end
34 changes: 31 additions & 3 deletions lib/affise.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,28 @@ class Affise {
}

/// Get referrer
@Deprecated('Use `Affise.getReferrerUrl` instead')
static void getReferrer(ReferrerCallback callback) {
getReferrerUrl(callback);
}

/// Get referrer Value
@Deprecated('Use `Affise.getReferrerUrlValue` instead')
static void getReferrerValue(ReferrerKey key, ReferrerCallback callback) {
getReferrerUrlValue(key, callback);
}

/// Get referrer
static void getReferrerUrl(ReferrerCallback callback) {
SchedulerBinding.instance.addPostFrameCallback((_) {
_native.getReferrer(callback);
_native.getReferrerUrl(callback);
});
}

/// Get referrer Value
static void getReferrerValue(ReferrerKey key, ReferrerCallback callback) {
static void getReferrerUrlValue(ReferrerKey key, ReferrerCallback callback) {
SchedulerBinding.instance.addPostFrameCallback((_) {
_native.getReferrerValue(key, callback);
_native.getReferrerUrlValue(key, callback);
});
}

Expand Down Expand Up @@ -338,6 +350,22 @@ class _AffiseIOS implements AffiseIOSApi {
native?.updatePostbackConversionValue(fineValue, coarseValue.value, completionHandler);
});
}

/// Get referrer on server
@override
void getReferrerOnServer(ReferrerCallback callback) {
SchedulerBinding.instance.addPostFrameCallback((_) {
native?.getReferrerOnServer(callback);
});
}

/// Get referrer on server value
@override
void getReferrerOnServerValue(ReferrerKey key, ReferrerCallback callback) {
SchedulerBinding.instance.addPostFrameCallback((_) {
native?.getReferrerOnServerValue(key, callback);
});
}
}

class _AffiseDebug implements AffiseDebug {
Expand Down
18 changes: 12 additions & 6 deletions lib/native/affise_api_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ enum AffiseApiMethod {
IS_FIRST_RUN,

// callbacks
GET_REFERRER_CALLBACK,
GET_REFERRER_VALUE_CALLBACK,
GET_REFERRER_URL_CALLBACK,
GET_REFERRER_URL_VALUE_CALLBACK,
GET_REFERRER_ON_SERVER_CALLBACK,
GET_REFERRER_ON_SERVER_VALUE_CALLBACK,
REGISTER_DEEPLINK_CALLBACK,
SKAD_REGISTER_ERROR_CALLBACK,
SKAD_POSTBACK_ERROR_CALLBACK,
Expand Down Expand Up @@ -99,10 +101,14 @@ extension AffiseApiMethodExt on AffiseApiMethod {
return "get_providers";
case AffiseApiMethod.IS_FIRST_RUN:
return "is_first_run";
case AffiseApiMethod.GET_REFERRER_CALLBACK:
return "get_referrer_callback";
case AffiseApiMethod.GET_REFERRER_VALUE_CALLBACK:
return "get_referrer_value_callback";
case AffiseApiMethod.GET_REFERRER_URL_CALLBACK:
return "get_referrer_url_callback";
case AffiseApiMethod.GET_REFERRER_URL_VALUE_CALLBACK:
return "get_referrer_url_value_callback";
case AffiseApiMethod.GET_REFERRER_ON_SERVER_CALLBACK:
return "get_referrer_on_server_callback";
case AffiseApiMethod.GET_REFERRER_ON_SERVER_VALUE_CALLBACK:
return "get_referrer_on_server_value_callback";
case AffiseApiMethod.REGISTER_DEEPLINK_CALLBACK:
return "register_deeplink_callback";
case AffiseApiMethod.SKAD_REGISTER_ERROR_CALLBACK:
Expand Down
Loading

0 comments on commit 5188d35

Please sign in to comment.