Skip to content

Commit

Permalink
Merge pull request #264 from qonversion/release/6.2.0
Browse files Browse the repository at this point in the history
Release 6.2.0
  • Loading branch information
suriksarkisyan authored Sep 25, 2023
2 parents 50c2382 + a4063e8 commit a2c5d58
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 14 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:3.1.1"
implementation "io.qonversion.sandwich:sandwich:3.2.0"
}

afterEvaluate { project ->
Expand Down
10 changes: 10 additions & 0 deletions android/src/main/java/com/reactlibrary/QonversionModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ public void detachUserFromExperiment(final String experimentId, final Promise pr
qonversionSandwich.detachUserFromExperiment(experimentId, Utils.getResultListener(promise));
}

@ReactMethod
public void attachUserToRemoteConfiguration(final String remoteConfigurationId, final Promise promise) {
qonversionSandwich.attachUserToRemoteConfiguration(remoteConfigurationId, Utils.getResultListener(promise));
}

@ReactMethod
public void detachUserFromRemoteConfiguration(final String remoteConfigurationId, final Promise promise) {
qonversionSandwich.detachUserFromRemoteConfiguration(remoteConfigurationId, Utils.getResultListener(promise));
}

@Override
public void onEntitlementsUpdated(@NonNull Map<String, ?> map) {
final WritableMap payload = EntitiesConverter.convertMapToWritableMap(map);
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.1.0):
- Qonversion/Main (= 5.1.0)
- Qonversion/Main (5.1.0)
- QonversionSandwich (3.1.0):
- Qonversion (= 5.1.0)
- Qonversion (5.2.0):
- Qonversion/Main (= 5.2.0)
- Qonversion/Main (5.2.0)
- QonversionSandwich (3.2.0):
- Qonversion (= 5.2.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 (6.0.1):
- QonversionSandwich (= 3.1.0)
- react-native-qonversion (6.1.0):
- QonversionSandwich (= 3.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: 97fb911fe1fdd68619cbcc9ec9248ca5a0324c3e
QonversionSandwich: 30c8a165f83143a8fa5f45685f2bbb71f7a44f7b
Qonversion: 7b56446a98f5a31bbe9a4611c6baa14e0bafa4c8
QonversionSandwich: fac00203d7b082871264b4383d3627fd1ec8d5bf
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: 1a0d9e12b6ac23451adbc8efd8091887274b17f9
react-native-qonversion: 354f01c4eb53b94be79ebedb34a8a83788543a8c
React-perflogger: e68d3795cf5d247a0379735cbac7309adf2fb931
React-RCTActionSheet: 05452c3b281edb27850253db13ecd4c5a65bc247
React-RCTAnimation: 578eebac706428e68466118e84aeacf3a282b4da
Expand Down
12 changes: 12 additions & 0 deletions ios/RNQonversion.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ + (BOOL)requiresMainQueueSetup
}];
}

RCT_EXPORT_METHOD(attachUserToRemoteConfiguration:(NSString *)remoteConfigurationId completion:(RCTResponseSenderBlock)completion rejecter:(RCTPromiseRejectBlock)reject) {
[_qonversionSandwich attachUserToRemoteConfigurationWith:remoteConfigurationId completion:^(NSDictionary<NSString *,id> * _Nullable result, SandwichError * _Nullable error) {
[self handleResult:result error:error completion:completion rejecter:reject];
}];
}

RCT_EXPORT_METHOD(detachUserFromRemoteConfiguration:(NSString *)remoteConfigurationId completion:(RCTResponseSenderBlock)completion rejecter:(RCTPromiseRejectBlock)reject) {
[_qonversionSandwich detachUserFromRemoteConfigurationWith:remoteConfigurationId completion:^(NSDictionary<NSString *,id> * _Nullable result, SandwichError * _Nullable error) {
[self handleResult:result error:error completion:completion rejecter:reject];
}];
}

RCT_EXPORT_METHOD(collectAdvertisingID) {
[_qonversionSandwich collectAdvertisingId];
}
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": "6.1.0",
"version": "6.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", "3.1.1"
s.dependency "QonversionSandwich", "3.2.0"
end
16 changes: 16 additions & 0 deletions src/QonversionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,22 @@ interface QonversionApi {
* @returns the promise for success result or throws an error otherwise.
*/
detachUserFromExperiment(experimentId: string): Promise<void>

/**
* This function should be used for the test purposes only. Do not forget to delete the usage of this function before the release.
* Use this function to attach the user to the remote configuration.
* @param remoteConfigurationId identifier of the remote configuration
* @returns the promise for success result or throws an error otherwise.
*/
attachUserToRemoteConfiguration(remoteConfigurationId: string): Promise<void>

/**
* This function should be used for the test purposes only. Do not forget to delete the usage of this function before the release.
* Use this function to detach the user from the remote configuration.
* @param remoteConfigurationId identifier of the remote configuration
* @returns the promise for success result or throws an error otherwise.
*/
detachUserFromRemoteConfiguration(remoteConfigurationId: string): Promise<void>
}

export default QonversionApi;
12 changes: 11 additions & 1 deletion src/internal/QonversionInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import UserProperties from '../dto/UserProperties';

const {RNQonversion} = NativeModules;

const sdkVersion = "6.1.0";
const sdkVersion = "6.2.0";

const EVENT_ENTITLEMENTS_UPDATED = "entitlements_updated";
const EVENT_PROMO_PURCHASE_RECEIVED = "promo_purchase_received";
Expand Down Expand Up @@ -297,4 +297,14 @@ export default class QonversionInternal implements QonversionApi {
await RNQonversion.detachUserFromExperiment(experimentId);
return;
}

async attachUserToRemoteConfiguration(remoteConfigurationId: string): Promise<void> {
await RNQonversion.attachUserToRemoteConfiguration(remoteConfigurationId);
return;
}

async detachUserFromRemoteConfiguration(remoteConfigurationId: string): Promise<void> {
await RNQonversion.detachUserFromRemoteConfiguration(remoteConfigurationId);
return;
}
}

0 comments on commit a2c5d58

Please sign in to comment.