@purchasely/cordova-plugin-purchasely 5.5.0 → 5.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "..": {
21
21
  "name": "@purchasely/cordova-plugin-purchasely",
22
- "version": "5.5.0",
22
+ "version": "5.5.1",
23
23
  "dev": true,
24
24
  "license": "ISC",
25
25
  "engines": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "../../purchasely-google": {
35
35
  "name": "@purchasely/cordova-plugin-puchasely-google",
36
- "version": "5.5.0",
36
+ "version": "5.5.1",
37
37
  "dev": true,
38
38
  "license": "ISC"
39
39
  },
@@ -22,10 +22,12 @@
22
22
  },
23
23
  "cordova": {
24
24
  "plugins": {
25
- "@purchasely/cordova-plugin-puchasely-google": {}
25
+ "@purchasely/cordova-plugin-puchasely-google": {},
26
+ "@purchasely/cordova-plugin-purchasely": {}
26
27
  },
27
28
  "platforms": [
28
- "android"
29
+ "android",
30
+ "ios"
29
31
  ]
30
32
  }
31
33
  }
@@ -252,6 +252,9 @@ function onPuchaselySdkReady() {
252
252
  } else if (result.action === Purchasely.PaywallAction.close) {
253
253
  console.log('User wants to close paywall - close reason ' + result.parameters.closeReason);
254
254
  Purchasely.onProcessAction(true);
255
+ } else if (result.action === Purchasely.PaywallAction.close_all) {
256
+ console.log('User wants to close all paywalls');
257
+ Purchasely.onProcessAction(true);
255
258
  } else if (result.action === Purchasely.PaywallAction.login) {
256
259
  console.log('User wants to login');
257
260
  //Present your own screen for user to log in
@@ -262,12 +265,19 @@ function onPuchaselySdkReady() {
262
265
  } else if (result.action === Purchasely.PaywallAction.open_presentation) {
263
266
  console.log('User wants to open a new paywall');
264
267
  Purchasely.onProcessAction(true);
268
+ } else if (result.action === Purchasely.PaywallAction.open_placement) {
269
+ console.log('User wants to open a new placement');
270
+ Purchasely.onProcessAction(true);
265
271
  } else if (result.action === Purchasely.PaywallAction.purchase) {
266
272
  console.log('User wants to purchase');
267
273
  //If you want to intercept it, close paywall and display your screen
268
274
  Purchasely.hidePresentation();
269
- } else if (result.action === Purchasely.PaywallAction.restore) {
270
- console.log('User wants to restore his purchases');
275
+ } else if (result.action === Purchasely.PaywallAction.web_checkout) {
276
+ console.log('User wants to proceed to web checkout');
277
+ console.log('web checkout url: ' + result.parameters.url);
278
+ console.log('web checkout provider: ' + result.parameters.webCheckoutProvider);
279
+ console.log('web checkout client reference id: ' + result.parameters.clientReferenceId);
280
+ console.log('web checkout query parameter key: ' + result.parameters.queryParameterKey);
271
281
  Purchasely.onProcessAction(true);
272
282
  } else {
273
283
  console.log('Action unknown ' + result.action);
@@ -279,8 +289,8 @@ function onPuchaselySdkReady() {
279
289
  }
280
290
 
281
291
  function openPresentation() {
282
- Purchasely.presentPresentationForPlacement(
283
- 'ONBOARDING', //placementId
292
+ Purchasely.presentPresentationWithIdentifier(
293
+ 'step_1', //placementId
284
294
  null, //contentId
285
295
  true, //fullscreen
286
296
  (callback) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purchasely/cordova-plugin-purchasely",
3
- "version": "5.5.0",
3
+ "version": "5.5.1",
4
4
  "description": "Purchasely is a solution to ease the integration and boost your In-App Purchases & Subscriptions on the App Store, Google Play Store, Amazon Appstore and Huawei App Gallery.",
5
5
  "cordova": {
6
6
  "id": "@purchasely/cordova-plugin-purchasely",
package/plugin.xml CHANGED
@@ -1,5 +1,5 @@
1
1
  <?xml version='1.0' encoding='utf-8'?>
2
- <plugin id="@purchasely/cordova-plugin-purchasely" version="5.5.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
2
+ <plugin id="@purchasely/cordova-plugin-purchasely" version="5.5.1" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
3
3
  <name>Purchasely</name>
4
4
  <js-module name="Purchasely" src="www/Purchasely.js">
5
5
  <clobbers target="Purchasely" />
@@ -63,7 +63,7 @@
63
63
  android:theme="@style/Theme.AppCompat.Light.NoActionBar">
64
64
  </activity>
65
65
  </config-file>
66
- <framework src="io.purchasely:core:5.5.0" />
66
+ <framework src="io.purchasely:core:5.5.1" />
67
67
  <source-file src="src/android/PurchaselyPlugin.kt" target-dir="java/cordova/plugin/purchasely" />
68
68
  <source-file src="src/android/PLYProductActivity.kt" target-dir="java/cordova/plugin/purchasely" />
69
69
  <source-file src="src/android/PLYSubscriptionsActivity.java" target-dir="src/cordova/plugin/purchasely" />
@@ -779,6 +779,9 @@ class PurchaselyPlugin : CordovaPlugin() {
779
779
  parametersForCordova["presentation"] = parameters.presentation
780
780
  parametersForCordova["placement"] = parameters.placement
781
781
  parametersForCordova["closeReason"] = parameters.closeReason?.name
782
+ parametersForCordova["clientReferenceId"] = parameters?.clientReferenceId
783
+ parametersForCordova["queryParameterKey"] = parameters?.queryParameterKey
784
+ parametersForCordova["webCheckoutProvider"] = parameters?.webCheckoutProvider?.name
782
785
 
783
786
  val result = PluginResult(
784
787
  PluginResult.Status.OK,
package/www/Purchasely.js CHANGED
@@ -5,7 +5,7 @@ var defaultError = (e) => { console.log(e); }
5
5
  exports.start = function (apiKey, stores, storekit1, userId, logLevel, runningMode, success, error) {
6
6
  var cordovaSdkVersion = cordova.define.moduleMap['cordova/plugin_list'].exports['metadata']['cordova-plugin-purchasely']
7
7
  if(!cordovaSdkVersion) {
8
- cordovaSdkVersion = "5.5.0";
8
+ cordovaSdkVersion = "5.5.1";
9
9
  }
10
10
  exec(success, error, 'Purchasely', 'start', [apiKey, stores, storekit1, userId, logLevel, runningMode, cordovaSdkVersion]);
11
11
  };
@@ -300,13 +300,15 @@ exports.RunningMode = {
300
300
 
301
301
  exports.PaywallAction = {
302
302
  close: 'close',
303
+ close_all: 'close_all',
303
304
  login: 'login',
304
305
  navigate: 'navigate',
305
306
  purchase: 'purchase',
306
307
  restore: 'restore',
307
308
  open_presentation: 'open_presentation',
308
- open_presentation: 'open_placement',
309
+ open_placement: 'open_placement',
309
310
  promo_code: 'promo_code',
311
+ web_checkout: 'web_checkout'
310
312
  }
311
313
 
312
314
  exports.ThemeMode = {