@umituz/react-native-subscription 2.14.102 → 2.14.103
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.14.
|
|
3
|
+
"version": "2.14.103",
|
|
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",
|
|
@@ -31,8 +31,6 @@ const waitForAuthState = async (getAuth: () => FirebaseAuthLike | null, timeoutM
|
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const isCreditPkg = (id: string, pat?: string) => id.toLowerCase().includes((pat || "credit").toLowerCase());
|
|
35
|
-
|
|
36
34
|
export const initializeSubscription = async (config: SubscriptionInitConfig): Promise<void> => {
|
|
37
35
|
const { apiKey, apiKeyIos, apiKeyAndroid, testStoreKey, entitlementId, credits, getAnonymousUserId, getFirebaseAuth, showAuthModal, onCreditsUpdated, creditPackages, timeoutMs = 10000, authStateTimeoutMs = 2000 } = config;
|
|
38
36
|
|
|
@@ -42,7 +40,6 @@ export const initializeSubscription = async (config: SubscriptionInitConfig): Pr
|
|
|
42
40
|
configureCreditsRepository({ ...credits, creditPackageAmounts: creditPackages?.amounts });
|
|
43
41
|
|
|
44
42
|
const onPurchase = async (userId: string, productId: string) => {
|
|
45
|
-
if (!isCreditPkg(productId, creditPackages?.identifierPattern)) return;
|
|
46
43
|
try {
|
|
47
44
|
await getCreditsRepository().initializeCredits(userId, `purchase_${productId}_${Date.now()}`, productId);
|
|
48
45
|
onCreditsUpdated?.(userId);
|