Skip to content

Commit a20e75e

Browse files
authored
Release 5.4.0
Release 5.4.0
2 parents 1f9d312 + 6450900 commit a20e75e

File tree

13 files changed

+100
-66
lines changed

13 files changed

+100
-66
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 5.4.0
2+
* Added function to sync transactions for StoreKit 2. The function should be used only in rare cases to avoid StoreKit 2 bugs. Contact us before using that function.
3+
* Parallel requests and race conditions fixed for entitlements state changing calls.
4+
15
## 5.3.1
26
* Fixed `collectAppleSearchAdsAttribution` call bug (`NoNecessaryDataError, Could not find necessary arguments`).
37

android/build.gradle

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

4444
dependencies {
4545
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
46-
implementation "io.qonversion.sandwich:sandwich:1.4.0"
46+
implementation "io.qonversion.sandwich:sandwich:1.5.1"
4747
implementation 'com.google.code.gson:gson:2.9.0'
4848
}

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.qonversion.sample">
22
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
33
calls FlutterMain.startInitialization(this); in its onCreate method.
44
In most cases you can leave this as-is, but you if you want to provide

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
/* Begin PBXBuildFile section */
1010
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1111
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12-
43F0075B596B77A45BCD05C7 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 903871E8DDE220888812221D /* Pods_Runner.framework */; };
1312
4CB27CA1276762D900DE51FD /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4CB27CA0276762D900DE51FD /* GoogleService-Info.plist */; };
1413
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
14+
8876821AD52624FFC742CB13 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B61BD248B3C1CEFD8465871F /* Pods_Runner.framework */; };
1515
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
1616
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1717
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -31,43 +31,43 @@
3131
/* End PBXCopyFilesBuildPhase section */
3232

3333
/* Begin PBXFileReference section */
34-
131CF8B1077064D487F80BBC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3534
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3635
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
37-
18FD979CEFEA604F81BD2F5C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
36+
1538A42E7A00EF2BFAA669B8 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
3837
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3938
4CB27CA0276762D900DE51FD /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
4039
6A76C3422936312F0071A79A /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
4140
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
4241
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4342
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
44-
903871E8DDE220888812221D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4543
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
4644
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
4745
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
4846
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4947
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
5048
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
5149
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
52-
D3FC8C61E5591E95F5115913 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
50+
B61BD248B3C1CEFD8465871F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
51+
C37D0D05833F6183AAFD2347 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
52+
C81D0B2B13DDF6679B092863 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
5353
/* End PBXFileReference section */
5454

5555
/* Begin PBXFrameworksBuildPhase section */
5656
97C146EB1CF9000F007C117D /* Frameworks */ = {
5757
isa = PBXFrameworksBuildPhase;
5858
buildActionMask = 2147483647;
5959
files = (
60-
43F0075B596B77A45BCD05C7 /* Pods_Runner.framework in Frameworks */,
60+
8876821AD52624FFC742CB13 /* Pods_Runner.framework in Frameworks */,
6161
);
6262
runOnlyForDeploymentPostprocessing = 0;
6363
};
6464
/* End PBXFrameworksBuildPhase section */
6565

6666
/* Begin PBXGroup section */
67-
6C726388C56723BCBA9C9D26 /* Frameworks */ = {
67+
59AF16F90FB67258EC083A19 /* Frameworks */ = {
6868
isa = PBXGroup;
6969
children = (
70-
903871E8DDE220888812221D /* Pods_Runner.framework */,
70+
B61BD248B3C1CEFD8465871F /* Pods_Runner.framework */,
7171
);
7272
name = Frameworks;
7373
sourceTree = "<group>";
@@ -91,7 +91,7 @@
9191
97C146F01CF9000F007C117D /* Runner */,
9292
97C146EF1CF9000F007C117D /* Products */,
9393
BA1CD22BB5800E684769C062 /* Pods */,
94-
6C726388C56723BCBA9C9D26 /* Frameworks */,
94+
59AF16F90FB67258EC083A19 /* Frameworks */,
9595
);
9696
sourceTree = "<group>";
9797
};
@@ -130,9 +130,9 @@
130130
BA1CD22BB5800E684769C062 /* Pods */ = {
131131
isa = PBXGroup;
132132
children = (
133-
D3FC8C61E5591E95F5115913 /* Pods-Runner.debug.xcconfig */,
134-
131CF8B1077064D487F80BBC /* Pods-Runner.release.xcconfig */,
135-
18FD979CEFEA604F81BD2F5C /* Pods-Runner.profile.xcconfig */,
133+
C81D0B2B13DDF6679B092863 /* Pods-Runner.debug.xcconfig */,
134+
C37D0D05833F6183AAFD2347 /* Pods-Runner.release.xcconfig */,
135+
1538A42E7A00EF2BFAA669B8 /* Pods-Runner.profile.xcconfig */,
136136
);
137137
path = Pods;
138138
sourceTree = "<group>";
@@ -144,14 +144,14 @@
144144
isa = PBXNativeTarget;
145145
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
146146
buildPhases = (
147-
3E553EC77D5986304FC57C61 /* [CP] Check Pods Manifest.lock */,
147+
51888B1652E2ABBF33C52A5C /* [CP] Check Pods Manifest.lock */,
148148
9740EEB61CF901F6004384FC /* Run Script */,
149149
97C146EA1CF9000F007C117D /* Sources */,
150150
97C146EB1CF9000F007C117D /* Frameworks */,
151151
97C146EC1CF9000F007C117D /* Resources */,
152152
9705A1C41CF9048500538489 /* Embed Frameworks */,
153153
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
154-
B08A069F413CCBC70A15A03C /* [CP] Embed Pods Frameworks */,
154+
42DCAA4B519DB859F15C66F7 /* [CP] Embed Pods Frameworks */,
155155
);
156156
buildRules = (
157157
);
@@ -227,43 +227,7 @@
227227
shellPath = /bin/sh;
228228
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed\n/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin\n";
229229
};
230-
3E553EC77D5986304FC57C61 /* [CP] Check Pods Manifest.lock */ = {
231-
isa = PBXShellScriptBuildPhase;
232-
buildActionMask = 2147483647;
233-
files = (
234-
);
235-
inputFileListPaths = (
236-
);
237-
inputPaths = (
238-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
239-
"${PODS_ROOT}/Manifest.lock",
240-
);
241-
name = "[CP] Check Pods Manifest.lock";
242-
outputFileListPaths = (
243-
);
244-
outputPaths = (
245-
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
246-
);
247-
runOnlyForDeploymentPostprocessing = 0;
248-
shellPath = /bin/sh;
249-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
250-
showEnvVarsInLog = 0;
251-
};
252-
9740EEB61CF901F6004384FC /* Run Script */ = {
253-
isa = PBXShellScriptBuildPhase;
254-
buildActionMask = 2147483647;
255-
files = (
256-
);
257-
inputPaths = (
258-
);
259-
name = "Run Script";
260-
outputPaths = (
261-
);
262-
runOnlyForDeploymentPostprocessing = 0;
263-
shellPath = /bin/sh;
264-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
265-
};
266-
B08A069F413CCBC70A15A03C /* [CP] Embed Pods Frameworks */ = {
230+
42DCAA4B519DB859F15C66F7 /* [CP] Embed Pods Frameworks */ = {
267231
isa = PBXShellScriptBuildPhase;
268232
buildActionMask = 2147483647;
269233
files = (
@@ -272,6 +236,7 @@
272236
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
273237
"${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework",
274238
"${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework",
239+
"${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework",
275240
"${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework",
276241
"${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework",
277242
"${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework",
@@ -287,6 +252,7 @@
287252
outputPaths = (
288253
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework",
289254
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework",
255+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework",
290256
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework",
291257
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework",
292258
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework",
@@ -303,6 +269,42 @@
303269
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
304270
showEnvVarsInLog = 0;
305271
};
272+
51888B1652E2ABBF33C52A5C /* [CP] Check Pods Manifest.lock */ = {
273+
isa = PBXShellScriptBuildPhase;
274+
buildActionMask = 2147483647;
275+
files = (
276+
);
277+
inputFileListPaths = (
278+
);
279+
inputPaths = (
280+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
281+
"${PODS_ROOT}/Manifest.lock",
282+
);
283+
name = "[CP] Check Pods Manifest.lock";
284+
outputFileListPaths = (
285+
);
286+
outputPaths = (
287+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
288+
);
289+
runOnlyForDeploymentPostprocessing = 0;
290+
shellPath = /bin/sh;
291+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
292+
showEnvVarsInLog = 0;
293+
};
294+
9740EEB61CF901F6004384FC /* Run Script */ = {
295+
isa = PBXShellScriptBuildPhase;
296+
buildActionMask = 2147483647;
297+
files = (
298+
);
299+
inputPaths = (
300+
);
301+
name = "Run Script";
302+
outputPaths = (
303+
);
304+
runOnlyForDeploymentPostprocessing = 0;
305+
shellPath = /bin/sh;
306+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
307+
};
306308
/* End PBXShellScriptBuildPhase section */
307309

308310
/* Begin PBXSourcesBuildPhase section */

example/pubspec.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ dependencies:
1515

1616
firebase_messaging: ^11.0.0
1717
flutter_local_notifications: ^9.1.0
18-
18+
19+
dependency_overrides:
20+
firebase_core_platform_interface: 4.5.1
21+
1922
dev_dependencies:
2023
flutter_test:
2124
sdk: flutter

ios/Classes/SwiftQonversionPlugin.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ public class SwiftQonversionPlugin: NSObject, FlutterPlugin {
4545

4646
switch (call.method) {
4747
case "syncHistoricalData":
48-
qonversionSandwich?.syncHistoricalData()
49-
return result(nil)
48+
qonversionSandwich?.syncHistoricalData()
49+
return result(nil)
50+
51+
case "syncStoreKit2Purchases":
52+
qonversionSandwich?.syncStoreKit2Purchases()
53+
return result(nil)
5054

5155
case "products":
5256
return products(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, '9.0'
19-
s.dependency "QonversionSandwich", "1.4.0"
19+
s.dependency "QonversionSandwich", "1.5.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/constants.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Constants {
2929
// MethodChannel methods names
3030
static const mInitialize = 'initialize';
3131
static const mSyncHistoricalData = 'syncHistoricalData';
32+
static const mSyncStoreKit2Purchases = 'syncStoreKit2Purchases';
3233
static const mProducts = 'products';
3334
static const mPurchase = 'purchase';
3435
static const mPurchaseProduct = 'purchaseProduct';

lib/src/internal/qonversion_internal.dart

Lines changed: 18 additions & 7 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 = "5.3.1";
14+
static const String _sdkVersion = "5.4.0";
1515

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

@@ -55,6 +55,13 @@ class QonversionInternal implements Qonversion {
5555
@override
5656
Future<void> syncHistoricalData() => _channel.invokeMethod(Constants.mSyncHistoricalData);
5757

58+
@override
59+
Future<void> syncStoreKit2Purchases() async {
60+
if (Platform.isIOS) {
61+
return _channel.invokeMethod(Constants.mSyncStoreKit2Purchases);
62+
}
63+
}
64+
5865
@override
5966
Future<Map<String, QEntitlement>> purchase(String productId) async {
6067
try {
@@ -100,7 +107,9 @@ class QonversionInternal implements Qonversion {
100107
final rawResult = await _channel.invokeMethod(Constants.mUpdatePurchase, {
101108
Constants.kNewProductId: newProductId,
102109
Constants.kOldProductId: oldProductId,
103-
Constants.kProrationMode: prorationMode != null ? prorationMode.index : null,
110+
Constants.kProrationMode: prorationMode != null
111+
? prorationMode.index
112+
: null,
104113
});
105114
final result = QMapper.entitlementsFromJson(rawResult);
106115
return result;
@@ -124,7 +133,9 @@ class QonversionInternal implements Qonversion {
124133
Constants.kNewProductId: newProduct.qonversionId,
125134
Constants.kOfferingId: newProduct.offeringID,
126135
Constants.kOldProductId: oldProductId,
127-
Constants.kProrationMode: prorationMode != null ? prorationMode.index : null,
136+
Constants.kProrationMode: prorationMode != null
137+
? prorationMode.index
138+
: null,
128139
});
129140
final result = QMapper.entitlementsFromJson(rawResult);
130141
return result;
@@ -269,10 +280,10 @@ class QonversionInternal implements Qonversion {
269280

270281
static QPurchaseException _convertPurchaseException(PlatformException error) {
271282
return QPurchaseException(
272-
error.code,
273-
error.message ?? "",
274-
error.details,
275-
isUserCancelled: error.code == "PurchaseCancelledByUser"
283+
error.code,
284+
error.message ?? "",
285+
error.details,
286+
isUserCancelled: error.code == "PurchaseCancelledByUser"
276287
);
277288
}
278289
}

lib/src/qonversion.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ abstract class Qonversion {
4646
/// Call this function to sync the subscriber data with the first launch when Qonversion is implemented.
4747
Future<void> syncHistoricalData();
4848

49+
/// iOS only
50+
/// Contact us before you start using this function
51+
/// Call this function to sync purchases if you are using StoreKit2 and our SDK in Analytics mode.
52+
Future<void> syncStoreKit2Purchases();
53+
4954
/// Starts a process of purchasing product with [productId].
5055
///
5156
/// Throws [QPurchaseException] in case of error in purchase flow.

0 commit comments

Comments
 (0)