Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ class QonversionModule(reactContext: ReactApplicationContext) : NativeQonversion
}

@ReactMethod
override fun identify(userID: String, promise: Promise) {
qonversionSandwich.identify(userID, getResultListener(promise))
override fun identify(userId: String, promise: Promise) {
qonversionSandwich.identify(userId, getResultListener(promise))
}

@ReactMethod
Expand Down
2 changes: 1 addition & 1 deletion ios/RNQonversion.mm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ - (void)isFallbackFileAccessible:(RCTPromiseResolveBlock)resolve reject:(RCTProm
}

- (void)collectAdvertisingId {
[self.impl collectAdvertisingID];
[self.impl collectAdvertisingId];
}

- (void)collectAppleSearchAdsAttribution {
Expand Down
2 changes: 1 addition & 1 deletion ios/RNQonversionImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public class RNQonversionImpl: NSObject {
}

@objc
public func collectAdvertisingID() {
public func collectAdvertisingId() {
qonversionSandwich?.collectAdvertisingId()
}

Expand Down
4 changes: 2 additions & 2 deletions src/QonversionApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ export interface QonversionApi {
/**
* Call this function to link a user to his unique ID in your system and share purchase data.
*
* @param userID unique user ID in your system
* @param userId unique user ID in your system
* @returns the promise with the information about the identified user.
*/
identify(userID: string): Promise<User>;
identify(userId: string): Promise<User>;

/**
* Call this function to unlink a user from his unique ID in your system and his purchase data.
Expand Down
2 changes: 1 addition & 1 deletion src/dto/Offering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Offering {
}

productForIdentifier(identifier: string): Product | undefined {
return this.products.find((object) => object.qonversionID === identifier);
return this.products.find((object) => object.qonversionId === identifier);
}
}

Expand Down
28 changes: 14 additions & 14 deletions src/dto/Product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import PurchaseUpdateModel from './PurchaseUpdateModel';
import SubscriptionPeriod from './SubscriptionPeriod';

class Product {
qonversionID: string;
storeID: string | null;
qonversionId: string;
storeId: string | null;

/**
* Identifier of the base plan for Google product.
*/
basePlanID: string | null;
basePlanId: string | null;

/**
* Google Play Store details of this product.
* Android only. Null for iOS, or if the product was not found.
* Doesn't take into account {@link basePlanID}.
* Doesn't take into account {@link basePlanId}.
* @deprecated Consider using {@link storeDetails} instead.
*/
skuDetails: SkuDetails | null;
Expand All @@ -39,7 +39,7 @@ class Product {
offeringId?: string | null;

/**
* For Android - the subscription base plan duration. If the {@link basePlanID} is not specified,
* For Android - the subscription base plan duration. If the {@link basePlanId} is not specified,
* the duration is calculated using the deprecated {@link skuDetails}.
* For iOS - the duration of the {@link skProduct}.
* Null, if it's not a subscription product or the product was not found in the store.
Expand All @@ -57,7 +57,7 @@ class Product {
/**
* The calculated type of this product based on the store information.
* On Android uses deprecated {@link skuDetails} for the old subscription products
* where {@link basePlanID} is not specified, and {@link storeDetails} for all the other products.
* where {@link basePlanId} is not specified, and {@link storeDetails} for all the other products.
* On iOS uses {@link skProduct} information.
*/
type: ProductType;
Expand All @@ -74,9 +74,9 @@ class Product {
prettyIntroductoryPrice?: string;

constructor(
qonversionID: string,
storeID: string,
basePlanID: string | null,
qonversionId: string,
storeId: string,
basePlanId: string | null,
skuDetails: SkuDetails | null,
storeDetails: ProductStoreDetails | null,
skProduct: SKProduct | null,
Expand All @@ -91,9 +91,9 @@ class Product {
storeDescription: string | undefined,
prettyIntroductoryPrice: string | undefined,
) {
this.qonversionID = qonversionID;
this.storeID = storeID;
this.basePlanID = basePlanID;
this.qonversionId = qonversionId;
this.storeId = storeId;
this.basePlanId = basePlanId;
this.skuDetails = skuDetails;
this.storeDetails = storeDetails;
this.skProduct = skProduct;
Expand All @@ -120,7 +120,7 @@ class Product {
* @returns purchase model to pass to the purchase method.
*/
toPurchaseModel(offerId: string | null = null): PurchaseModel {
return new PurchaseModel(this.qonversionID, offerId);
return new PurchaseModel(this.qonversionId, offerId);
}

/**
Expand Down Expand Up @@ -152,7 +152,7 @@ class Product {
oldProductId: string,
updatePolicy: PurchaseUpdatePolicy | null = null
): PurchaseUpdateModel {
return new PurchaseUpdateModel(this.qonversionID, oldProductId, updatePolicy);
return new PurchaseUpdateModel(this.qonversionId, oldProductId, updatePolicy);
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/internal/QonversionInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class QonversionInternal implements QonversionApi {
if (isAndroid()) {
return null;
}
const promoOffer = await RNQonversion.getPromotionalOffer(product.qonversionID, discount.identifier);
const promoOffer = await RNQonversion.getPromotionalOffer(product.qonversionId, discount.identifier);
const mappedPromoOffer: PromotionalOffer | null = Mapper.convertPromoOffer(promoOffer);

return mappedPromoOffer;
Expand All @@ -89,7 +89,7 @@ export default class QonversionInternal implements QonversionApi {

if (isIos()) {
purchasePromise = RNQonversion.purchase(
product.qonversionID,
product.qonversionId,
options.quantity,
options.contextKeys,
promoOffer,
Expand All @@ -100,13 +100,13 @@ export default class QonversionInternal implements QonversionApi {
);
} else {
purchasePromise = RNQonversion.purchase(
product.qonversionID,
product.qonversionId,
1,
options.contextKeys,
undefined,
options.offerId,
options.applyOffer,
options.oldProduct?.qonversionID,
options.oldProduct?.qonversionId,
options.updatePolicy,
);
}
Expand Down Expand Up @@ -231,8 +231,8 @@ export default class QonversionInternal implements QonversionApi {
RNQonversion.syncPurchases();
}

async identify(userID: string): Promise<User> {
const userInfo = await RNQonversion.identify(userID);
async identify(userId: string): Promise<User> {
const userInfo = await RNQonversion.identify(userId);
const mappedUserInfo: User = Mapper.convertUserInfo(userInfo);

return mappedUserInfo;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/specs/NativeQonversionModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface Spec extends TurboModule {
checkEntitlements(): Promise<Object>; // Record<string, QEntitlement>
restore(): Promise<Object>; // Record<string, QEntitlement>
syncPurchases(): void;
identify(userID: string): Promise<QUser>;
identify(userId: string): Promise<QUser>;
logout(): void;
userInfo(): Promise<QUser>;
addAttributionData(data: Object, provider: string): void;
Expand Down