@umituz/react-native-subscription 2.24.10 → 2.24.12

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.10",
3
+ "version": "2.24.12",
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",
@@ -110,8 +110,23 @@ export const initializeSubscription = async (config: SubscriptionInitConfig): Pr
110
110
  });
111
111
 
112
112
  const userId = await waitForAuthState(getFirebaseAuth, authStateTimeoutMs);
113
- const timeout = new Promise((_, reject) => setTimeout(() => reject(new Error("Timeout")), timeoutMs));
114
- await Promise.race([SubscriptionManager.initialize(userId), timeout]);
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: () => {