Skip to content

Commit bb05786

Browse files
authored
Release 8.4.0
Release 8.4.0
2 parents f6f1573 + 192e030 commit bb05786

File tree

10 files changed

+21
-14
lines changed

10 files changed

+21
-14
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 8.4.0
2+
* Added returning promise to the `identify` method. You may see warnings for ignoring the returned promise after updating to this version until you update the usage to asynchronous. If you don't need to know the identification result, simply ignore it.
3+
14
## 8.3.1
25
* Fixed privacy manifest file
36

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ android {
5151

5252
dependencies {
5353
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
54-
implementation "io.qonversion.sandwich:sandwich:4.3.2"
54+
implementation "io.qonversion.sandwich:sandwich:4.4.1"
5555
implementation 'com.google.code.gson:gson:2.9.0'
5656
}

android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/QonversionPlugin.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ class QonversionPlugin : MethodCallHandler, FlutterPlugin, ActivityAware {
173173
return
174174
}
175175

176-
qonversionSandwich.identify(userId)
177-
result.success(null)
176+
qonversionSandwich.identify(userId, result.toResultListener())
178177
}
179178

180179
private fun purchase(args: Map<String, Any>, result: Result) {

ios/Classes/SwiftQonversionPlugin.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ public class SwiftQonversionPlugin: NSObject, FlutterPlugin {
198198
return
199199
}
200200

201-
qonversionSandwich?.identify(userId)
202-
result(nil)
201+
qonversionSandwich?.identify(userId, getDefaultCompletion(result))
203202
}
204203

205204
private func products(_ result: @escaping FlutterResult) {

ios/qonversion_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
s.source_files = 'Classes/**/*'
1717
s.dependency 'Flutter'
1818
s.platform = :ios, '9.0'
19-
s.dependency "QonversionSandwich", "4.3.2"
19+
s.dependency "QonversionSandwich", "4.4.1"
2020

2121
# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
2222
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }

lib/src/internal/qonversion_internal.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:qonversion_flutter/src/internal/utils/string.dart';
1111
import 'constants.dart';
1212

1313
class QonversionInternal implements Qonversion {
14-
static const String _sdkVersion = "8.3.1";
14+
static const String _sdkVersion = "8.4.0";
1515

1616
final MethodChannel _channel = MethodChannel('qonversion_plugin');
1717

@@ -153,8 +153,15 @@ class QonversionInternal implements Qonversion {
153153
}
154154

155155
@override
156-
Future<void> identify(String userId) =>
157-
_channel.invokeMethod(Constants.mIdentify, {Constants.kUserId: userId});
156+
Future<QUser> identify(String userId) async {
157+
final rawResult = await _channel.invokeMethod(Constants.mIdentify, {Constants.kUserId: userId});
158+
159+
final result = QMapper.userFromJson(rawResult);
160+
if (result == null) {
161+
throw new Exception("User deserialization failed");
162+
}
163+
return result;
164+
}
158165

159166
@override
160167
Future<void> logout() => _channel.invokeMethod(Constants.mLogout);

lib/src/qonversion.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ abstract class Qonversion {
113113

114114
/// Call this function to link a user to his unique ID in your system and share purchase data.
115115
/// [userId] unique user ID in your system
116-
Future<void> identify(String userId);
116+
Future<QUser> identify(String userId);
117117

118118
/// Call this function to unlink a user from his unique ID in your system and his purchase data.
119119
Future<void> logout();

macos/Classes/SwiftQonversionPlugin.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ public class SwiftQonversionPlugin: NSObject, FlutterPlugin {
156156
return
157157
}
158158

159-
qonversionSandwich?.identify(userId)
160-
result(nil)
159+
qonversionSandwich?.identify(userId, getDefaultCompletion(result))
161160
}
162161

163162
private func products(_ result: @escaping FlutterResult) {

macos/qonversion_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
s.source_files = 'Classes/**/*'
1717
s.dependency 'FlutterMacOS'
1818
s.platform = :osx, '10.12'
19-
s.dependency "QonversionSandwich", "4.3.2"
19+
s.dependency "QonversionSandwich", "4.4.1"
2020

2121
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
2222
s.swift_version = '5.0'

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: qonversion_flutter
22
description: Flutter plugin to implement in-app subscriptions and purchases. Validate user receipts and manage cross-platform access to paid content on your app. Android & iOS.
3-
version: 8.3.1
3+
version: 8.4.0
44
homepage: 'https://qonversion.io'
55
repository: 'https://github.com/qonversion/flutter-sdk'
66

0 commit comments

Comments
 (0)