Skip to content

Commit 14ac9ea

Browse files
authored
Merge pull request #375 from qonversion/tech/sc-40572/majorChanges
ID and Id synchronization
2 parents 552221d + fd723cc commit 14ac9ea

8 files changed

Lines changed: 28 additions & 28 deletions

File tree

android/src/main/java/com/qonversion/reactnativesdk/QonversionModule.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ class QonversionModule(reactContext: ReactApplicationContext) : NativeQonversion
172172
}
173173

174174
@ReactMethod
175-
override fun identify(userID: String, promise: Promise) {
176-
qonversionSandwich.identify(userID, getResultListener(promise))
175+
override fun identify(userId: String, promise: Promise) {
176+
qonversionSandwich.identify(userId, getResultListener(promise))
177177
}
178178

179179
@ReactMethod

ios/RNQonversion.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ - (void)isFallbackFileAccessible:(RCTPromiseResolveBlock)resolve reject:(RCTProm
124124
}
125125

126126
- (void)collectAdvertisingId {
127-
[self.impl collectAdvertisingID];
127+
[self.impl collectAdvertisingId];
128128
}
129129

130130
- (void)collectAppleSearchAdsAttribution {

ios/RNQonversionImpl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public class RNQonversionImpl: NSObject {
213213
}
214214

215215
@objc
216-
public func collectAdvertisingID() {
216+
public func collectAdvertisingId() {
217217
qonversionSandwich?.collectAdvertisingId()
218218
}
219219

src/QonversionApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ export interface QonversionApi {
150150
/**
151151
* Call this function to link a user to his unique ID in your system and share purchase data.
152152
*
153-
* @param userID unique user ID in your system
153+
* @param userId unique user ID in your system
154154
* @returns the promise with the information about the identified user.
155155
*/
156-
identify(userID: string): Promise<User>;
156+
identify(userId: string): Promise<User>;
157157

158158
/**
159159
* Call this function to unlink a user from his unique ID in your system and his purchase data.

src/dto/Offering.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Offering {
1313
}
1414

1515
productForIdentifier(identifier: string): Product | undefined {
16-
return this.products.find((object) => object.qonversionID === identifier);
16+
return this.products.find((object) => object.qonversionId === identifier);
1717
}
1818
}
1919

src/dto/Product.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ import PurchaseUpdateModel from './PurchaseUpdateModel';
88
import SubscriptionPeriod from './SubscriptionPeriod';
99

1010
class Product {
11-
qonversionID: string;
12-
storeID: string | null;
11+
qonversionId: string;
12+
storeId: string | null;
1313

1414
/**
1515
* Identifier of the base plan for Google product.
1616
*/
17-
basePlanID: string | null;
17+
basePlanId: string | null;
1818

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

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

7676
constructor(
77-
qonversionID: string,
78-
storeID: string,
79-
basePlanID: string | null,
77+
qonversionId: string,
78+
storeId: string,
79+
basePlanId: string | null,
8080
skuDetails: SkuDetails | null,
8181
storeDetails: ProductStoreDetails | null,
8282
skProduct: SKProduct | null,
@@ -91,9 +91,9 @@ class Product {
9191
storeDescription: string | undefined,
9292
prettyIntroductoryPrice: string | undefined,
9393
) {
94-
this.qonversionID = qonversionID;
95-
this.storeID = storeID;
96-
this.basePlanID = basePlanID;
94+
this.qonversionId = qonversionId;
95+
this.storeId = storeId;
96+
this.basePlanId = basePlanId;
9797
this.skuDetails = skuDetails;
9898
this.storeDetails = storeDetails;
9999
this.skProduct = skProduct;
@@ -120,7 +120,7 @@ class Product {
120120
* @returns purchase model to pass to the purchase method.
121121
*/
122122
toPurchaseModel(offerId: string | null = null): PurchaseModel {
123-
return new PurchaseModel(this.qonversionID, offerId);
123+
return new PurchaseModel(this.qonversionId, offerId);
124124
}
125125

126126
/**
@@ -152,7 +152,7 @@ class Product {
152152
oldProductId: string,
153153
updatePolicy: PurchaseUpdatePolicy | null = null
154154
): PurchaseUpdateModel {
155-
return new PurchaseUpdateModel(this.qonversionID, oldProductId, updatePolicy);
155+
return new PurchaseUpdateModel(this.qonversionId, oldProductId, updatePolicy);
156156
}
157157
}
158158

src/internal/QonversionInternal.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default class QonversionInternal implements QonversionApi {
6666
if (isAndroid()) {
6767
return null;
6868
}
69-
const promoOffer = await RNQonversion.getPromotionalOffer(product.qonversionID, discount.identifier);
69+
const promoOffer = await RNQonversion.getPromotionalOffer(product.qonversionId, discount.identifier);
7070
const mappedPromoOffer: PromotionalOffer | null = Mapper.convertPromoOffer(promoOffer);
7171

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

9090
if (isIos()) {
9191
purchasePromise = RNQonversion.purchase(
92-
product.qonversionID,
92+
product.qonversionId,
9393
options.quantity,
9494
options.contextKeys,
9595
promoOffer,
@@ -100,13 +100,13 @@ export default class QonversionInternal implements QonversionApi {
100100
);
101101
} else {
102102
purchasePromise = RNQonversion.purchase(
103-
product.qonversionID,
103+
product.qonversionId,
104104
1,
105105
options.contextKeys,
106106
undefined,
107107
options.offerId,
108108
options.applyOffer,
109-
options.oldProduct?.qonversionID,
109+
options.oldProduct?.qonversionId,
110110
options.updatePolicy,
111111
);
112112
}
@@ -231,8 +231,8 @@ export default class QonversionInternal implements QonversionApi {
231231
RNQonversion.syncPurchases();
232232
}
233233

234-
async identify(userID: string): Promise<User> {
235-
const userInfo = await RNQonversion.identify(userID);
234+
async identify(userId: string): Promise<User> {
235+
const userInfo = await RNQonversion.identify(userId);
236236
const mappedUserInfo: User = Mapper.convertUserInfo(userInfo);
237237

238238
return mappedUserInfo;

src/internal/specs/NativeQonversionModule.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface Spec extends TurboModule {
4949
checkEntitlements(): Promise<Object>; // Record<string, QEntitlement>
5050
restore(): Promise<Object>; // Record<string, QEntitlement>
5151
syncPurchases(): void;
52-
identify(userID: string): Promise<QUser>;
52+
identify(userId: string): Promise<QUser>;
5353
logout(): void;
5454
userInfo(): Promise<QUser>;
5555
addAttributionData(data: Object, provider: string): void;

0 commit comments

Comments
 (0)