Skip to content

Commit

Permalink
Release 8.4.0
Browse files Browse the repository at this point in the history
Release 8.4.0
  • Loading branch information
SpertsyanKM authored May 7, 2024
2 parents f6f1573 + 192e030 commit bb05786
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 8.4.0
* 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.

## 8.3.1
* Fixed privacy manifest file

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "io.qonversion.sandwich:sandwich:4.3.2"
implementation "io.qonversion.sandwich:sandwich:4.4.1"
implementation 'com.google.code.gson:gson:2.9.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ class QonversionPlugin : MethodCallHandler, FlutterPlugin, ActivityAware {
return
}

qonversionSandwich.identify(userId)
result.success(null)
qonversionSandwich.identify(userId, result.toResultListener())
}

private fun purchase(args: Map<String, Any>, result: Result) {
Expand Down
3 changes: 1 addition & 2 deletions ios/Classes/SwiftQonversionPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ public class SwiftQonversionPlugin: NSObject, FlutterPlugin {
return
}

qonversionSandwich?.identify(userId)
result(nil)
qonversionSandwich?.identify(userId, getDefaultCompletion(result))
}

private func products(_ result: @escaping FlutterResult) {
Expand Down
2 changes: 1 addition & 1 deletion ios/qonversion_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '9.0'
s.dependency "QonversionSandwich", "4.3.2"
s.dependency "QonversionSandwich", "4.4.1"

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
Expand Down
13 changes: 10 additions & 3 deletions lib/src/internal/qonversion_internal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:qonversion_flutter/src/internal/utils/string.dart';
import 'constants.dart';

class QonversionInternal implements Qonversion {
static const String _sdkVersion = "8.3.1";
static const String _sdkVersion = "8.4.0";

final MethodChannel _channel = MethodChannel('qonversion_plugin');

Expand Down Expand Up @@ -153,8 +153,15 @@ class QonversionInternal implements Qonversion {
}

@override
Future<void> identify(String userId) =>
_channel.invokeMethod(Constants.mIdentify, {Constants.kUserId: userId});
Future<QUser> identify(String userId) async {
final rawResult = await _channel.invokeMethod(Constants.mIdentify, {Constants.kUserId: userId});

final result = QMapper.userFromJson(rawResult);
if (result == null) {
throw new Exception("User deserialization failed");
}
return result;
}

@override
Future<void> logout() => _channel.invokeMethod(Constants.mLogout);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/qonversion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ abstract class Qonversion {

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

/// Call this function to unlink a user from his unique ID in your system and his purchase data.
Future<void> logout();
Expand Down
3 changes: 1 addition & 2 deletions macos/Classes/SwiftQonversionPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ public class SwiftQonversionPlugin: NSObject, FlutterPlugin {
return
}

qonversionSandwich?.identify(userId)
result(nil)
qonversionSandwich?.identify(userId, getDefaultCompletion(result))
}

private func products(_ result: @escaping FlutterResult) {
Expand Down
2 changes: 1 addition & 1 deletion macos/qonversion_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'
s.dependency 'FlutterMacOS'
s.platform = :osx, '10.12'
s.dependency "QonversionSandwich", "4.3.2"
s.dependency "QonversionSandwich", "4.4.1"

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.0'
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: qonversion_flutter
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.
version: 8.3.1
version: 8.4.0
homepage: 'https://qonversion.io'
repository: 'https://github.com/qonversion/flutter-sdk'

Expand Down

0 comments on commit bb05786

Please sign in to comment.