@umituz/react-native-subscription 2.2.47 → 2.2.49

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.2.47",
3
+ "version": "2.2.49",
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",
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "peerDependencies": {
30
30
  "@tanstack/react-query": ">=5.0.0",
31
- "@umituz/react-native-design-system": "latest",
31
+ "@umituz/react-native-design-system": "*",
32
32
  "@umituz/react-native-firestore": "*",
33
33
  "@umituz/react-native-legal": "*",
34
- "@umituz/react-native-localization": ">=3.0.0",
34
+ "@umituz/react-native-localization": "*",
35
35
  "expo-constants": ">=18.0.0",
36
36
  "firebase": ">=10.0.0",
37
37
  "react": ">=18.2.0",
@@ -40,15 +40,30 @@
40
40
  "react-native-safe-area-context": ">=4.0.0"
41
41
  },
42
42
  "devDependencies": {
43
+ "@expo/vector-icons": "^15.0.3",
44
+ "@react-native-async-storage/async-storage": "^2.2.0",
45
+ "@react-native-community/datetimepicker": "^8.5.1",
46
+ "@react-native-firebase/analytics": "^23.7.0",
47
+ "@react-native-firebase/app": "^23.7.0",
48
+ "@react-native-firebase/crashlytics": "^23.7.0",
49
+ "@react-native-firebase/firestore": "^23.7.0",
50
+ "@react-navigation/native": "^7.1.26",
43
51
  "@tanstack/react-query": "^5.90.12",
44
52
  "@types/node": "^25.0.3",
45
53
  "@types/react": "~19.1.10",
46
- "@umituz/react-native-design-system": "latest",
47
- "@umituz/react-native-firestore": "latest",
48
- "@umituz/react-native-legal": "latest",
49
- "@umituz/react-native-localization": "latest",
54
+ "@umituz/react-native-design-system": "^2.0.7",
55
+ "@umituz/react-native-device": "^1.5.2",
56
+ "@umituz/react-native-firebase": "*",
57
+ "@umituz/react-native-firestore": "^1.13.4",
58
+ "@umituz/react-native-icons": "^1.1.2",
59
+ "@umituz/react-native-legal": "*",
60
+ "@umituz/react-native-localization": "^3.5.21",
61
+ "@umituz/react-native-storage": "^2.4.4",
50
62
  "expo-constants": "~18.0.12",
63
+ "expo-localization": "^17.0.8",
51
64
  "firebase": "^12.6.0",
65
+ "i18next": "^25.7.3",
66
+ "react-i18next": "^16.5.0",
52
67
  "react-native": "0.81.5",
53
68
  "react-native-purchases": "^9.6.10",
54
69
  "react-native-safe-area-context": "~5.6.0",
@@ -62,4 +77,4 @@
62
77
  "README.md",
63
78
  "LICENSE"
64
79
  ]
65
- }
80
+ }
@@ -60,5 +60,10 @@ export interface IRevenueCatService {
60
60
  * Check if RevenueCat is initialized
61
61
  */
62
62
  isInitialized(): boolean;
63
+
64
+ /**
65
+ * Get current user ID
66
+ */
67
+ getCurrentUserId(): string | null;
63
68
  }
64
69
 
@@ -43,7 +43,19 @@ export class RevenueCatService implements IRevenueCatService {
43
43
  return this.stateManager.isUsingTestStore();
44
44
  }
45
45
 
46
+ getCurrentUserId(): string | null {
47
+ return this.stateManager.getCurrentUserId();
48
+ }
49
+
46
50
  async initialize(userId: string, apiKey?: string): Promise<InitializeResult> {
51
+ // If already initialized for this user, return success immediately
52
+ if (this.isInitialized() && this.getCurrentUserId() === userId) {
53
+ if (__DEV__) {
54
+ console.log("[RevenueCat] Already initialized for user:", userId);
55
+ }
56
+ return { success: true, offering: (await this.fetchOfferings()), hasPremium: false }; // fetchOfferings handles cache usually
57
+ }
58
+
47
59
  const result = await initializeSDK(
48
60
  {
49
61
  config: this.stateManager.getConfig(),