@umituz/react-native-subscription 2.24.11 → 2.24.13
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.24.
|
|
3
|
+
"version": "2.24.13",
|
|
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",
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* Paywall Hooks Index
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
export { usePaywall } from
|
|
6
|
-
export { useSubscriptionModal } from
|
|
5
|
+
export { usePaywall } from './usePaywall';
|
|
6
|
+
export { useSubscriptionModal } from './useSubscriptionModal';
|
|
7
|
+
export { usePaywallActions } from './usePaywallActions';
|
|
7
8
|
export {
|
|
8
9
|
usePaywallTranslations,
|
|
9
10
|
type UsePaywallTranslationsParams,
|
|
10
11
|
type UsePaywallTranslationsResult,
|
|
11
|
-
} from
|
|
12
|
+
} from './usePaywallTranslations';
|
|
@@ -110,8 +110,23 @@ export const initializeSubscription = async (config: SubscriptionInitConfig): Pr
|
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
const userId = await waitForAuthState(getFirebaseAuth, authStateTimeoutMs);
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
|
|
114
|
+
// Initialize subscription without blocking - let it complete in background
|
|
115
|
+
try {
|
|
116
|
+
if (timeoutMs > 0) {
|
|
117
|
+
const timeout = new Promise<boolean>((_, reject) =>
|
|
118
|
+
setTimeout(() => reject(new Error("Timeout")), timeoutMs)
|
|
119
|
+
);
|
|
120
|
+
await Promise.race([SubscriptionManager.initialize(userId), timeout]);
|
|
121
|
+
} else {
|
|
122
|
+
await SubscriptionManager.initialize(userId);
|
|
123
|
+
}
|
|
124
|
+
} catch (error) {
|
|
125
|
+
// Log error but don't throw - subscription will continue in background
|
|
126
|
+
if (__DEV__) {
|
|
127
|
+
console.warn('[SubscriptionInitializer] Initialize timeout/error (non-critical):', error);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
115
130
|
|
|
116
131
|
configureAuthProvider({
|
|
117
132
|
isAuthenticated: () => {
|