@umituz/react-native-subscription 2.20.0 → 2.20.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-subscription",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.1",
|
|
4
4
|
"description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -61,9 +61,6 @@ export const initializeSubscription = async (config: SubscriptionInitConfig): Pr
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
// Note: Renewal credits should be handled server-side via RevenueCat webhooks + Cloud Functions
|
|
65
|
-
// Client-side listener cannot reliably detect renewals vs new purchases
|
|
66
|
-
|
|
67
64
|
SubscriptionManager.configure({
|
|
68
65
|
config: { apiKey: key, testStoreKey, entitlementIdentifier: entitlementId, consumableProductIdentifiers: [creditPackages?.identifierPattern || "credit"], onPurchaseCompleted: onPurchase, onCreditsUpdated },
|
|
69
66
|
apiKey: key, getAnonymousUserId
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Customer Info Listener Manager
|
|
3
3
|
* Handles RevenueCat customer info update listeners
|
|
4
|
-
* Only syncs premium status - renewal handling should be done server-side via webhooks
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
6
|
import Purchases, {
|
|
@@ -15,10 +14,6 @@ export class CustomerInfoListenerManager {
|
|
|
15
14
|
private listener: CustomerInfoUpdateListener | null = null;
|
|
16
15
|
private currentUserId: string | null = null;
|
|
17
16
|
|
|
18
|
-
constructor(_entitlementIdentifier: string) {
|
|
19
|
-
// entitlementIdentifier kept for API compatibility
|
|
20
|
-
}
|
|
21
|
-
|
|
22
17
|
setUserId(userId: string): void {
|
|
23
18
|
this.currentUserId = userId;
|
|
24
19
|
}
|
|
@@ -27,10 +22,6 @@ export class CustomerInfoListenerManager {
|
|
|
27
22
|
this.currentUserId = null;
|
|
28
23
|
}
|
|
29
24
|
|
|
30
|
-
notifyPurchaseCompleted(): void {
|
|
31
|
-
// Reserved for future use if needed
|
|
32
|
-
}
|
|
33
|
-
|
|
34
25
|
setupListener(config: RevenueCatConfig): void {
|
|
35
26
|
this.removeListener();
|
|
36
27
|
|
|
@@ -39,7 +30,6 @@ export class CustomerInfoListenerManager {
|
|
|
39
30
|
return;
|
|
40
31
|
}
|
|
41
32
|
|
|
42
|
-
// Only sync premium status - renewal credits handled server-side via webhooks
|
|
43
33
|
syncPremiumStatus(config, this.currentUserId, customerInfo);
|
|
44
34
|
};
|
|
45
35
|
|
|
@@ -30,9 +30,7 @@ export class RevenueCatService implements IRevenueCatService {
|
|
|
30
30
|
|
|
31
31
|
constructor(config: RevenueCatConfig) {
|
|
32
32
|
this.stateManager = new ServiceStateManager(config);
|
|
33
|
-
this.listenerManager = new CustomerInfoListenerManager(
|
|
34
|
-
config.entitlementIdentifier
|
|
35
|
-
);
|
|
33
|
+
this.listenerManager = new CustomerInfoListenerManager();
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
getRevenueCatKey(): string | null {
|
|
@@ -89,11 +87,7 @@ export class RevenueCatService implements IRevenueCatService {
|
|
|
89
87
|
pkg: PurchasesPackage,
|
|
90
88
|
userId: string
|
|
91
89
|
): Promise<PurchaseResult> {
|
|
92
|
-
|
|
93
|
-
if (result.success) {
|
|
94
|
-
this.listenerManager.notifyPurchaseCompleted();
|
|
95
|
-
}
|
|
96
|
-
return result;
|
|
90
|
+
return handlePurchase(this.getSDKParams(), pkg, userId);
|
|
97
91
|
}
|
|
98
92
|
|
|
99
93
|
async restorePurchases(userId: string): Promise<RestoreResult> {
|