) {
+ this.remoteConfigs = remoteConfigs;
+ }
+
+ remoteConfigForContextKey(contextKey: string): RemoteConfig | undefined {
+ return this.findRemoteConfigForContextKey(contextKey);
+ }
+
+ remoteConfigForEmptyContextKey(): RemoteConfig | undefined {
+ return this.findRemoteConfigForContextKey(null);
+ }
+
+ private findRemoteConfigForContextKey(contextKey: string | null): RemoteConfig | undefined {
+ return this.remoteConfigs.find(config => config.source.contextKey == contextKey);
+ }
+}
diff --git a/sample/package.json b/sample/package.json
index ff75fac..0597414 100644
--- a/sample/package.json
+++ b/sample/package.json
@@ -28,6 +28,8 @@
"android",
"ios"
],
- "plugins": {}
+ "plugins": {
+ "cordova-plugin-qonversion": {}
+ }
}
-}
+}
\ No newline at end of file
diff --git a/sample/www/index.html b/sample/www/index.html
index 7fc9897..42287b0 100644
--- a/sample/www/index.html
+++ b/sample/www/index.html
@@ -57,6 +57,7 @@ Qonversion Cordova Plugin
+
diff --git a/sample/www/js/index.js b/sample/www/js/index.js
index b1c6b22..395939f 100644
--- a/sample/www/js/index.js
+++ b/sample/www/js/index.js
@@ -29,6 +29,7 @@ const app = {
document.getElementById("update-purchase").addEventListener("click", this.updatePurchase);
document.getElementById("get-products").addEventListener("click", this.getProducts);
document.getElementById("get-remote-config").addEventListener("click", this.getRemoteConfig);
+ document.getElementById("get-remote-config-list").addEventListener("click", this.getRemoteConfigList);
document.getElementById("get-offerings").addEventListener("click", this.getOfferings);
document.getElementById("check-trial-into").addEventListener("click", this.checkTrialIntroEligibility);
document.getElementById("check-entitlements").addEventListener("click", this.checkEntitlements);
@@ -113,6 +114,11 @@ const app = {
console.log('Qonversion remote config:', remoteConfig);
},
+ async getRemoteConfigList() {
+ const remoteConfigList = await Qonversion.getSharedInstance().remoteConfigList();
+ console.log('Qonversion remote config list:', remoteConfigList);
+ },
+
async getOfferings() {
const offerings = await Qonversion.getSharedInstance().offerings();
console.log('Qonversion offerings:', offerings);
diff --git a/sample/yarn.lock b/sample/yarn.lock
index 2021512..e5ad1d7 100644
--- a/sample/yarn.lock
+++ b/sample/yarn.lock
@@ -184,7 +184,7 @@ cordova-plugin-device@^2.1.0:
integrity sha512-FU0Lw1jZpuKOgG4v80LrfMAOIMCGfAVPumn7AwaX9S1iU/X3OPZUyoKUgP09q4bxL35IeNPkqNWVKYduAXZ1sg==
"cordova-plugin-qonversion@file:../plugin":
- version "5.0.0"
+ version "5.2.0"
resolved "file:../plugin"
cross-spawn@^7.0.1, cross-spawn@^7.0.3: