Skip to content

Commit c4420aa

Browse files
Merge pull request #449 from qonversion/release/11.7.0
Release 11.7.0
2 parents 0c155d7 + c310b23 commit c4420aa

14 files changed

Lines changed: 59 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 11.7.0
2+
* // Update changelog here
3+
14
## 11.6.0
25
* // Update changelog here
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:7.8.0"
54+
implementation "io.qonversion:sandwich:7.9.0"
5555
implementation 'com.google.code.gson:gson:2.9.0'
5656
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class NoCodesPlugin(private val messenger: BinaryMessenger, private val context:
106106
}
107107
}
108108

109-
fun showNoCodesScreen(contextKey: String?, result: Result) {
109+
fun showNoCodesScreen(contextKey: String?, customVariables: Map<String, String>?, result: Result) {
110110
if (contextKey != null) {
111-
noCodesSandwich?.showScreen(contextKey)
111+
noCodesSandwich?.showScreen(contextKey, customVariables)
112112
result.success(null)
113113
} else {
114114
result.noNecessaryDataError()

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ class QonversionPlugin : MethodCallHandler, FlutterPlugin, ActivityAware {
105105
"userProperties" -> {
106106
return userProperties(result)
107107
}
108+
"forceSendProperties" -> {
109+
return forceSendProperties(result)
110+
}
108111
"logout" -> {
109112
qonversionSandwich.logout()
110113
return result.success(null)
@@ -159,7 +162,7 @@ class QonversionPlugin : MethodCallHandler, FlutterPlugin, ActivityAware {
159162
// NoCodes methods
160163
"initializeNoCodes" -> noCodesPlugin?.initializeNoCodes(args, result)
161164
"setScreenPresentationConfig" -> noCodesPlugin?.setScreenPresentationConfig(args["config"] as? Map<String, Any>, args["contextKey"] as? String, result)
162-
"showNoCodesScreen" -> noCodesPlugin?.showNoCodesScreen(args["contextKey"] as? String, result)
165+
"showNoCodesScreen" -> noCodesPlugin?.showNoCodesScreen(args["contextKey"] as? String, args["customVariables"] as? Map<String, String>, result)
163166
"setNoCodesLocale" -> noCodesPlugin?.setLocale(args["locale"] as? String, result)
164167
"setNoCodesTheme" -> noCodesPlugin?.setTheme(args["theme"] as? String, result)
165168
// NoCodes Purchase Delegate methods
@@ -252,6 +255,12 @@ class QonversionPlugin : MethodCallHandler, FlutterPlugin, ActivityAware {
252255
qonversionSandwich.userProperties(result.toJsonResultListener())
253256
}
254257

258+
private fun forceSendProperties(result: Result) {
259+
qonversionSandwich.forceSendProperties {
260+
result.success(null)
261+
}
262+
}
263+
255264
private fun isFallbackFileAccessible(result: Result) {
256265
qonversionSandwich.isFallbackFileAccessible(result.toJsonResultListener())
257266
}

ios/Classes/NoCodesPlugin.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ public class NoCodesPlugin: NSObject {
112112
let contextKey = args["contextKey"] as? String else {
113113
return result(FlutterError.noNecessaryData)
114114
}
115-
116-
noCodesSandwich?.showScreen(contextKey)
115+
116+
let customVariables = args["customVariables"] as? [String: String]
117+
118+
noCodesSandwich?.showScreen(contextKey, customVariables: customVariables)
117119
result(nil)
118120
}
119121

ios/Classes/SwiftQonversionPlugin.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ public class SwiftQonversionPlugin: NSObject, FlutterPlugin {
8484
case "userProperties":
8585
return userProperties(result)
8686

87+
case "forceSendProperties":
88+
return forceSendProperties(result)
89+
8790
case "presentCodeRedemptionSheet":
8891
return presentCodeRedemptionSheet(result)
8992

@@ -312,6 +315,12 @@ public class SwiftQonversionPlugin: NSObject, FlutterPlugin {
312315
private func userProperties(_ result: @escaping FlutterResult) {
313316
qonversionSandwich?.userProperties(getJsonCompletion(result))
314317
}
318+
319+
private func forceSendProperties(_ result: @escaping FlutterResult) {
320+
qonversionSandwich?.forceSendProperties {
321+
result(nil)
322+
}
323+
}
315324

316325
private func restore(_ result: @escaping FlutterResult) {
317326
qonversionSandwich?.restore(getJsonCompletion(result))

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, '13.0'
19-
s.dependency "QonversionSandwich", "7.8.0"
19+
s.dependency "QonversionSandwich", "7.9.0"
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/constants.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class Constants {
3838
static const kSource = 'source';
3939
static const kLocale = 'locale';
4040
static const kTheme = 'theme';
41+
static const kCustomVariables = 'customVariables';
4142

4243
// MethodChannel methods names
4344
static const mInitialize = 'initialize';
@@ -54,6 +55,7 @@ class Constants {
5455
static const mSetDefinedUserProperty = 'setDefinedUserProperty';
5556
static const mSetCustomUserProperty = 'setCustomUserProperty';
5657
static const mUserProperties = 'userProperties';
58+
static const mForceSendProperties = 'forceSendProperties';
5759
static const mSetEntitlementsCacheLifetime = 'setEntitlementsCacheLifetime';
5860
static const mSyncPurchases = 'syncPurchases';
5961
static const mAddAttributionData = 'addAttributionData';

lib/src/internal/nocodes_internal.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,16 @@ class NoCodesInternal implements NoCodes {
167167
}
168168

169169
@override
170-
Future<void> showScreen(String contextKey) async {
170+
Future<void> showScreen(String contextKey, {Map<String, String>? customVariables}) async {
171171
if (Platform.isMacOS) {
172172
return;
173173
}
174-
175-
await _invokeMethod(Constants.mShowNoCodesScreen, {Constants.kContextKey: contextKey});
174+
175+
final args = <String, dynamic>{
176+
Constants.kContextKey: contextKey,
177+
if (customVariables != null) Constants.kCustomVariables: customVariables,
178+
};
179+
await _invokeMethod(Constants.mShowNoCodesScreen, args);
176180
}
177181

178182
@override

lib/src/internal/qonversion_internal.dart

Lines changed: 6 additions & 1 deletion
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 = "11.6.0";
14+
static const String sdkVersion = "11.7.0";
1515

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

@@ -420,6 +420,11 @@ class QonversionInternal implements Qonversion {
420420
});
421421
}
422422

423+
@override
424+
Future<void> forceSendProperties() async {
425+
await _invokeMethod(Constants.mForceSendProperties);
426+
}
427+
423428
@override
424429
Future<QUserProperties> userProperties() async {
425430
final rawResult = await _invokeMethod(Constants.mUserProperties);

0 commit comments

Comments
 (0)