Skip to content

Commit

Permalink
Release 7.2.0
Browse files Browse the repository at this point in the history
Release 7.2.0
  • Loading branch information
SpertsyanKM committed Mar 8, 2024
2 parents 17a4805 + 3f3cbcc commit f898cb9
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
implementation "io.qonversion.sandwich:sandwich:4.1.1"
implementation "io.qonversion.sandwich:sandwich:4.2.0"
}

afterEvaluate { project ->
Expand Down
4 changes: 2 additions & 2 deletions android/src/main/java/com/reactlibrary/QonversionModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ public void userInfo(final Promise promise) {
}

@ReactMethod
public void remoteConfig(final Promise promise) {
qonversionSandwich.remoteConfig(Utils.getResultListener(promise));
public void remoteConfig(@Nullable final String contextKey, final Promise promise) {
qonversionSandwich.remoteConfig(contextKey, Utils.getResultListener(promise));
}

@ReactMethod
Expand Down
20 changes: 10 additions & 10 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ PODS:
- glog (0.3.5)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.1100)
- Qonversion (5.6.0):
- Qonversion/Main (= 5.6.0)
- Qonversion/Main (5.6.0)
- QonversionSandwich (4.1.1):
- Qonversion (= 5.6.0)
- Qonversion (5.7.0):
- Qonversion/Main (= 5.7.0)
- Qonversion/Main (5.7.0)
- QonversionSandwich (4.2.0):
- Qonversion (= 5.7.0)
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -289,8 +289,8 @@ PODS:
- React-jsinspector (0.70.5)
- React-logger (0.70.5):
- glog
- react-native-qonversion (7.0.0):
- QonversionSandwich (= 4.1.1)
- react-native-qonversion (7.1.0):
- QonversionSandwich (= 4.2.0)
- React
- React-perflogger (0.70.5)
- React-RCTActionSheet (0.70.5):
Expand Down Expand Up @@ -534,8 +534,8 @@ SPEC CHECKSUMS:
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
Qonversion: 37357948d6e90b2cc31e1277c6a30d38b92d8af8
QonversionSandwich: c1ec24a2a6753c6b3d4743c34fcf66a7c57d1f8a
Qonversion: 28eb7795cb52b83de3461898cf1c2b527545f860
QonversionSandwich: 0fb2014d2828ad3d1eb05929094b6f18719edf01
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
RCTRequired: 21229f84411088e5d8538f21212de49e46cc83e2
RCTTypeSafety: 62eed57a32924b09edaaf170a548d1fc96223086
Expand All @@ -550,7 +550,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: 31564fa6912459921568e8b0e49024285a4d584b
React-jsinspector: badd81696361249893a80477983e697aab3c1a34
React-logger: fdda34dd285bdb0232e059b19d9606fa0ec3bb9c
react-native-qonversion: f54b60c427ccf68d780e41bc59468ec089926627
react-native-qonversion: 35ad7f4be25eeb59a8affd20998c2a801f5b3cfa
React-perflogger: e68d3795cf5d247a0379735cbac7309adf2fb931
React-RCTActionSheet: 05452c3b281edb27850253db13ecd4c5a65bc247
React-RCTAnimation: 578eebac706428e68466118e84aeacf3a282b4da
Expand Down
4 changes: 2 additions & 2 deletions ios/RNQonversion.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ + (BOOL)requiresMainQueueSetup
}];
}

RCT_EXPORT_METHOD(remoteConfig:(RCTResponseSenderBlock)completion rejecter:(RCTPromiseRejectBlock)reject) {
[_qonversionSandwich remoteConfig:^(NSDictionary<NSString *,id> * _Nullable result, SandwichError * _Nullable error) {
RCT_EXPORT_METHOD(remoteConfig:(NSString *)contextKey completion:(RCTResponseSenderBlock)completion rejecter:(RCTPromiseRejectBlock)reject) {
[_qonversionSandwich remoteConfig:contextKey :^(NSDictionary<NSString *,id> * _Nullable result, SandwichError * _Nullable error) {
[self handleResult:result error:error completion:completion rejecter:reject];
}];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-qonversion",
"title": "React Native Qonversion",
"version": "7.1.0",
"version": "7.2.0",
"description": "Qonversion provides full in-app purchases infrastructure, so you do not need to build your own server for receipt validation. Implement in-app subscriptions, validate user receipts, check subscription status, and provide access to your app features and content using our StoreKit wrapper and Google Play Billing wrapper.",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion react-native-qonversion.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Pod::Spec.new do |s|
s.requires_arc = true

s.dependency "React"
s.dependency "QonversionSandwich", "4.1.1"
s.dependency "QonversionSandwich", "4.2.0"
end
4 changes: 2 additions & 2 deletions src/QonversionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ interface QonversionApi {
presentCodeRedemptionSheet(): void;

/**
* Returns Qonversion remote config object
* Returns Qonversion remote config object by {@link contextKey} or default one if the key is not specified.
* Use this function to get the remote config with specific payload and experiment info.
* @returns the promise with the remote config.
*/
remoteConfig(): Promise<RemoteConfig>
remoteConfig(contextKey: string | undefined): Promise<RemoteConfig>

/**
* This function should be used for the test purposes only. Do not forget to delete the usage of this function before the release.
Expand Down
10 changes: 9 additions & 1 deletion src/dto/RemoteConfigurationSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ class RemoteConfigurationSource {
name: string;
type: RemoteConfigurationSourceType;
assignmentType: RemoteConfigurationAssignmentType;
contextKey: string | null;

constructor(id: string, name: string, type: RemoteConfigurationSourceType, assignmentType: RemoteConfigurationAssignmentType) {
constructor(
id: string,
name: string,
type: RemoteConfigurationSourceType,
assignmentType: RemoteConfigurationAssignmentType,
contextKey: string | null,
) {
this.id = id;
this.name = name;
this.type = type;
this.assignmentType = assignmentType;
this.contextKey = contextKey;
}
}

Expand Down
9 changes: 8 additions & 1 deletion src/internal/Mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ type QRemoteConfigurationSource = {
name: string;
type: string;
assignmentType: string;
contextKey: string | null | undefined;
};

type QExperiment = {
Expand Down Expand Up @@ -986,7 +987,13 @@ class Mapper {
const sourceType = this.convertRemoteConfigurationSourceType(remoteConfig.source.type);
const assignmentType = this.convertRemoteConfigurationAssignmentType(remoteConfig.source.assignmentType);

const source = new RemoteConfigurationSource(remoteConfig.source.id, remoteConfig.source.name, sourceType, assignmentType)
const source = new RemoteConfigurationSource(
remoteConfig.source.id,
remoteConfig.source.name,
sourceType,
assignmentType,
remoteConfig.source.contextKey ?? null,
)

return new RemoteConfig(remoteConfig.payload, experiment, source);
}
Expand Down
6 changes: 3 additions & 3 deletions src/internal/QonversionInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import PurchaseUpdateModel from '../dto/PurchaseUpdateModel';

const {RNQonversion} = NativeModules;

const sdkVersion = "7.1.0";
const sdkVersion = "7.2.0";

const EVENT_ENTITLEMENTS_UPDATED = "entitlements_updated";
const EVENT_PROMO_PURCHASE_RECEIVED = "promo_purchase_received";
Expand Down Expand Up @@ -241,8 +241,8 @@ export default class QonversionInternal implements QonversionApi {
}
}

async remoteConfig(): Promise<RemoteConfig> {
const remoteConfig = await RNQonversion.remoteConfig();
async remoteConfig(contextKey: string | undefined): Promise<RemoteConfig> {
const remoteConfig = await RNQonversion.remoteConfig(contextKey);
const mappedRemoteConfig: RemoteConfig = Mapper.convertRemoteConfig(remoteConfig);

return mappedRemoteConfig;
Expand Down

0 comments on commit f898cb9

Please sign in to comment.