Skip to content

Commit

Permalink
Merge pull request #94 from qonversion/release/6.1.1
Browse files Browse the repository at this point in the history
Release 6.1.1
  • Loading branch information
SpertsyanKM committed Sep 4, 2024
2 parents ee9bedd + 4eb8a66 commit f33190a
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-qonversion",
"version": "6.1.0",
"version": "6.1.1",
"description": "Qonversion Cordova Plugin",
"cordova": {
"id": "cordova-plugin-qonversion",
Expand Down
4 changes: 2 additions & 2 deletions plugin/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<param name="android-package" value="com.qonversion.android.sdk.QonversionPlugin"/>
</feature>
</config-file>
<framework src="io.qonversion.sandwich:sandwich:5.1.2" />
<framework src="io.qonversion.sandwich:sandwich:5.1.3" />
<source-file src="src/android/QonversionPlugin.java" target-dir="src/com/qonversion/android/sdk" />
<source-file src="src/android/EntitiesConverter.java" target-dir="src/com/qonversion/android/sdk" />
<source-file src="src/android/Utils.java" target-dir="src/com/qonversion/android/sdk" />
Expand All @@ -75,7 +75,7 @@
<source url="https://github.com/CocoaPods/Specs.git"/>
</config>
<pods use-frameworks="true">
<pod name="QonversionSandwich" spec="5.1.2" />
<pod name="QonversionSandwich" spec="5.1.3" />
</pods>
</podspec>
</platform>
Expand Down
5 changes: 4 additions & 1 deletion plugin/src/android/QonversionPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ public void purchase(
CallbackContext callbackContext
) {
try {
List<String> contextKeysList = EntitiesConverter.convertArrayToStringList(contextKeys);
List<String> contextKeysList = contextKeys == null
? null
: EntitiesConverter.convertArrayToStringList(contextKeys);

qonversionSandwich.purchase(
productId,
offerId,
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/plugin/QonversionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface QonversionApi {
*
* @see [Making Purchases](https://documentation.qonversion.io/docs/making-purchases)
*/
purchaseProduct(product: Product, options: PurchaseOptions): Promise<Map<string, Entitlement>>
purchaseProduct(product: Product, options: PurchaseOptions | undefined): Promise<Map<string, Entitlement>>

/**
* Make a purchase and validate it through server-to-server using Qonversion's Backend.
Expand Down
11 changes: 8 additions & 3 deletions plugin/src/plugin/QonversionInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ import {RemoteConfigList} from "./RemoteConfigList";
import {UserProperties} from './UserProperties';
import {PurchaseModel} from './PurchaseModel';
import {PurchaseUpdateModel} from './PurchaseUpdateModel';
import {PurchaseOptions} from "./PurchaseOptions";;
import {PurchaseOptions} from "./PurchaseOptions";
import {PurchaseOptionsBuilder} from './PurchaseOptionsBuilder';

const sdkVersion = "6.1.0";
const sdkVersion = "6.1.1";

export default class QonversionInternal implements QonversionApi {

Expand Down Expand Up @@ -63,8 +64,12 @@ export default class QonversionInternal implements QonversionApi {
}
}

async purchaseProduct(product: Product, options: PurchaseOptions): Promise<Map<string, Entitlement>> {
async purchaseProduct(product: Product, options: PurchaseOptions | undefined): Promise<Map<string, Entitlement>> {
try {
if (!options) {
options = new PurchaseOptionsBuilder().build();
}

let args: any[] = [product.qonversionID]
if (isIos()) {
args = [...args, options.quantity, options.contextKeys];
Expand Down
4 changes: 2 additions & 2 deletions sample/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ const app = {
const products = await Qonversion.getSharedInstance().products();
const product = products.get(productId);
try {
const purchaseModel = product.toPurchaseModel(offerId);
const entitlements = await Qonversion.getSharedInstance().purchase(purchaseModel);
const purchaseOptions = !!offerId ? new Qonversion.PurchaseOptionsBuilder().setOfferId(offerId) : undefined;
const entitlements = await Qonversion.getSharedInstance().purchaseProduct(product, purchaseOptions);
console.log('Qonversion purchase:', entitlements, productId);
} catch (e) {
console.log('Qonversion purchase failed', e);
Expand Down
30 changes: 20 additions & 10 deletions sample/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ cordova-plugin-device@^3.0.0:
integrity sha512-g8fFYOvleeYpklWvHwZ/T8/IzJe/3O0MGVDIUoqBru4v8SNDAbNVD3oOqoOQANBWGFQMg7GIkAAl8errCHZ7zQ==

"cordova-plugin-qonversion@file:../plugin":
version "6.0.1"
version "6.1.0"
resolved "file:../plugin"

cross-spawn@^7.0.1, cross-spawn@^7.0.3:
Expand Down Expand Up @@ -276,7 +276,17 @@ fs-extra@^10.1.0:
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^9.0.0, fs-extra@^9.1.0:
fs-extra@^9.0.0:
version "9.1.0"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz"
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"

fs-extra@^9.1.0:
version "9.1.0"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz"
integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==
Expand Down Expand Up @@ -365,10 +375,10 @@ ios-sim@^8.0.2:
plist "^3.0.1"
simctl "^2"

is-core-module@^2.11.0:
version "2.12.1"
resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz"
integrity sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==
is-core-module@^2.13.0:
version "2.13.0"
resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz"
integrity sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==
dependencies:
has "^1.0.3"

Expand Down Expand Up @@ -571,11 +581,11 @@ rechoir@^0.6.2:
resolve "^1.1.6"

resolve@^1.1.6:
version "1.22.2"
resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz"
integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==
version "1.22.4"
resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz"
integrity sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==
dependencies:
is-core-module "^2.11.0"
is-core-module "^2.13.0"
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"

Expand Down

0 comments on commit f33190a

Please sign in to comment.