From 36e22ec871b76b068c95c53a36e3905307269dc4 Mon Sep 17 00:00:00 2001 From: Sergey Korney Date: Wed, 13 Mar 2024 18:26:53 +0500 Subject: [PATCH] 1.6.13 --- README.md | 26 ++++++++++------ android/build.gradle | 2 +- example/android/app/build.gradle | 8 ++--- example/ios/Podfile | 4 +-- example/pubspec.lock | 48 +++++++++++++++--------------- ios/affise_attribution_lib.podspec | 2 +- lib/affise.dart | 13 ++++++++ lib/native/affise_api_method.dart | 3 ++ lib/native/affise_native.dart | 4 +++ pubspec.yaml | 2 +- 10 files changed, 70 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 6762361..66b659b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ | Package | Version | |--------------------------|:--------------------------------------------------------:| -| `affise_attribution_lib` | [`1.6.12`](https://github.com/affise/sdk-react/releases) | +| `affise_attribution_lib` | [`1.6.13`](https://github.com/affise/sdk-react/releases) | - [Affise Attribution Flutter Library](#affise-attribution-flutter-library) - [Description](#description) @@ -48,6 +48,7 @@ - [Get random user Id](#get-random-user-id) - [Get random device Id](#get-random-device-id) - [Get providers](#get-providers) + - [Is first run](#is-first-run) - [Get referrer](#get-referrer) - [Get referrer value](#get-referrer-value) - [Referrer keys](#referrer-keys) @@ -114,10 +115,10 @@ Example [`example/android/app/build.gradle`](example/android/app/build.gradle) ```gradle dependencies { // Affise modules - implementation 'com.affise:module-advertising:1.6.23' - implementation 'com.affise:module-network:1.6.23' - implementation 'com.affise:module-phone:1.6.23' - implementation 'com.affise:module-status:1.6.23' + implementation 'com.affise:module-advertising:1.6.26' + implementation 'com.affise:module-network:1.6.26' + implementation 'com.affise:module-phone:1.6.26' + implementation 'com.affise:module-status:1.6.26' } ``` @@ -127,8 +128,8 @@ Add modules to iOS project | Module | Version | Start | |---------------|:------------------------------------------------------------------------------------:|----------| -| `ADVERTISING` | [`1.6.25`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` | -| `STATUS` | [`1.6.25`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | +| `ADVERTISING` | [`1.6.27`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` | +| `STATUS` | [`1.6.27`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto` | Example [example/ios/Podfile](example/ios/Podfile) @@ -137,8 +138,8 @@ target 'Runner' do # ... # Affise Modules - pod 'AffiseModule/Advertising', `1.6.25` - pod 'AffiseModule/Status', `1.6.25` + pod 'AffiseModule/Advertising', `1.6.27` + pod 'AffiseModule/Status', `1.6.27` end ``` @@ -839,6 +840,13 @@ Affise.getProviders().then((providers) { }); ``` +## Is first run +```dart +Affise.isFirstRun().then((isFirstRun) { + // handle +}); +``` + ## Get referrer Use the next public method of SDK diff --git a/android/build.gradle b/android/build.gradle index 1e4bbc2..52c39f7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -48,5 +48,5 @@ android { dependencies { implementation "com.android.installreferrer:installreferrer:2.2" - implementation "com.affise:internal:1.6.23" + implementation "com.affise:internal:1.6.26" } \ No newline at end of file diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 399688c..406512b 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -69,8 +69,8 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // Affise modules - implementation 'com.affise:module-advertising:1.6.23' - implementation 'com.affise:module-network:1.6.23' - implementation 'com.affise:module-phone:1.6.23' - implementation "com.affise:module-status:1.6.23" + implementation 'com.affise:module-advertising:1.6.26' + implementation 'com.affise:module-network:1.6.26' + implementation 'com.affise:module-phone:1.6.26' + implementation "com.affise:module-status:1.6.26" } diff --git a/example/ios/Podfile b/example/ios/Podfile index 1afba2f..f428ee1 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -34,8 +34,8 @@ target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) # Affise modules - pod 'AffiseModule/Advertising', '1.6.25' - pod 'AffiseModule/Status', '1.6.25' + pod 'AffiseModule/Advertising', '1.6.27' + pod 'AffiseModule/Status', '1.6.27' end post_install do |installer| diff --git a/example/pubspec.lock b/example/pubspec.lock index ca4a4bb..9872ada 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,31 +7,31 @@ packages: path: ".." relative: true source: path - version: "1.6.12" + version: "1.6.13" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: "271b8899fc99f9df4f4ed419fa14e2fff392c7b2c162fbb87b222e2e963ddc73" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.9.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + sha256: "5bbf32bc9e518d41ec49718e2931cd4527292c9b0c6d2dffcf7fe6b9a8a8cf72" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.0" characters: dependency: transitive description: name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.1" clock: dependency: transitive description: @@ -44,10 +44,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: ef7e3a5529178ce8f37a9d0b11cbbc8b1e025940f9cf9f76c42da6796301219d url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: @@ -94,10 +94,10 @@ packages: dependency: transitive description: name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + sha256: a5e201311cb08bf3912ebbe9a2be096e182d703f881136ec1e81a2338a9e120d url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "0.6.4" lints: dependency: transitive description: @@ -110,10 +110,10 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "80c2989398773fa06e2457e9ff08580f24e9858b28462a722241cb53e5613478" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.12" material_color_utilities: dependency: transitive description: @@ -126,18 +126,18 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.8.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.8.2" plugin_platform_interface: dependency: transitive description: @@ -163,10 +163,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: f8d9f247e2f9f90e32d1495ff32dac7e4ae34ffa7194c5ff8fcc0fd0e52df774 url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.10.0" stream_channel: dependency: transitive description: @@ -179,10 +179,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "862015c5db1f3f3c4ea3b94dc2490363a84262994b88902315ed74be1155612f" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.1.1" term_glyph: dependency: transitive description: @@ -195,10 +195,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: ceeddf59d613e862e77f4b506cfc2945ac9637ce0b4c00f4f4c1ac639f3e9731 url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.4.14" vector_math: dependency: transitive description: @@ -208,5 +208,5 @@ packages: source: hosted version: "2.1.4" sdks: - dart: ">=3.0.0-0 <4.0.0" + dart: ">=2.18.0 <4.0.0" flutter: ">=2.5.0" diff --git a/ios/affise_attribution_lib.podspec b/ios/affise_attribution_lib.podspec index 2d7f67a..4aba65c 100644 --- a/ios/affise_attribution_lib.podspec +++ b/ios/affise_attribution_lib.podspec @@ -21,6 +21,6 @@ Affise Attribution Flutter plugin. s.swift_version = '5.0' s.dependency 'Flutter' - s.dependency 'AffiseInternal', '1.6.25' + s.dependency 'AffiseInternal', '1.6.27' end diff --git a/lib/affise.dart b/lib/affise.dart index c6166a9..31150a3 100644 --- a/lib/affise.dart +++ b/lib/affise.dart @@ -220,6 +220,19 @@ class Affise { return completer.future; } + /// Is it first run + static Future isFirstRun() async { + var completer = Completer(); + SchedulerBinding.instance.addPostFrameCallback((_) { + _native.isFirstRun().then((value) { + completer.complete(value); + }).catchError((error) { + completer.completeError(error); + }); + }); + return completer.future; + } + /// Get referrer static void getReferrer(ReferrerCallback callback) { SchedulerBinding.instance.addPostFrameCallback((_) { diff --git a/lib/native/affise_api_method.dart b/lib/native/affise_api_method.dart index 8ee9351..791a7bb 100644 --- a/lib/native/affise_api_method.dart +++ b/lib/native/affise_api_method.dart @@ -22,6 +22,7 @@ enum AffiseApiMethod { GET_PROVIDERS, MODULE_START, GET_MODULES_INSTALLED, + IS_FIRST_RUN, // callbacks GET_REFERRER_CALLBACK, @@ -91,6 +92,8 @@ extension AffiseApiMethodExt on AffiseApiMethod { return "module_start"; case AffiseApiMethod.GET_MODULES_INSTALLED: return "get_modules_installed"; + case AffiseApiMethod.IS_FIRST_RUN: + return "is_first_run"; case AffiseApiMethod.GET_REFERRER_CALLBACK: return "get_referrer_callback"; case AffiseApiMethod.GET_REFERRER_VALUE_CALLBACK: diff --git a/lib/native/affise_native.dart b/lib/native/affise_native.dart index 1a33070..e0efac2 100644 --- a/lib/native/affise_native.dart +++ b/lib/native/affise_native.dart @@ -129,6 +129,10 @@ class AffiseNative extends NativeBase { return result; } + Future isFirstRun() async { + return await native(AffiseApiMethod.IS_FIRST_RUN); + } + Future getRandomUserId() async { return await native(AffiseApiMethod.GET_RANDOM_USER_ID); } diff --git a/pubspec.yaml b/pubspec.yaml index 102d204..7c7dc9e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: affise_attribution_lib description: Affise Attribution Flutter plugin. -version: 1.6.12 +version: 1.6.13 homepage: https://affise.com/ environment: