@umituz/react-native-subscription 2.8.0 → 2.9.0
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.
|
|
3
|
+
"version": "2.9.0",
|
|
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",
|
|
@@ -10,6 +10,7 @@ import { SubscriptionManager } from "../../infrastructure/managers/SubscriptionM
|
|
|
10
10
|
import {
|
|
11
11
|
trackPackageError,
|
|
12
12
|
addPackageBreadcrumb,
|
|
13
|
+
trackPackageEvent,
|
|
13
14
|
} from "@umituz/react-native-sentry";
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -111,6 +112,11 @@ export const usePurchasePackage = (userId: string | undefined) => {
|
|
|
111
112
|
throw new Error("User not authenticated");
|
|
112
113
|
}
|
|
113
114
|
|
|
115
|
+
trackPackageEvent("subscription", "purchase_started", {
|
|
116
|
+
packageId: pkg.identifier,
|
|
117
|
+
userId,
|
|
118
|
+
});
|
|
119
|
+
|
|
114
120
|
addPackageBreadcrumb("subscription", "Purchase mutation started", {
|
|
115
121
|
packageId: pkg.identifier,
|
|
116
122
|
userId,
|
|
@@ -119,11 +125,21 @@ export const usePurchasePackage = (userId: string | undefined) => {
|
|
|
119
125
|
const success = await SubscriptionManager.purchasePackage(pkg);
|
|
120
126
|
|
|
121
127
|
if (success) {
|
|
128
|
+
trackPackageEvent("subscription", "purchase_success", {
|
|
129
|
+
packageId: pkg.identifier,
|
|
130
|
+
userId,
|
|
131
|
+
});
|
|
132
|
+
|
|
122
133
|
addPackageBreadcrumb("subscription", "Purchase mutation success", {
|
|
123
134
|
packageId: pkg.identifier,
|
|
124
135
|
userId,
|
|
125
136
|
});
|
|
126
137
|
} else {
|
|
138
|
+
trackPackageEvent("subscription", "purchase_cancelled", {
|
|
139
|
+
packageId: pkg.identifier,
|
|
140
|
+
userId,
|
|
141
|
+
});
|
|
142
|
+
|
|
127
143
|
addPackageBreadcrumb("subscription", "Purchase mutation failed", {
|
|
128
144
|
packageId: pkg.identifier,
|
|
129
145
|
userId,
|
|
@@ -162,6 +178,10 @@ export const useRestorePurchase = (userId: string | undefined) => {
|
|
|
162
178
|
throw new Error("User not authenticated");
|
|
163
179
|
}
|
|
164
180
|
|
|
181
|
+
trackPackageEvent("subscription", "restore_started", {
|
|
182
|
+
userId,
|
|
183
|
+
});
|
|
184
|
+
|
|
165
185
|
addPackageBreadcrumb("subscription", "Restore mutation started", {
|
|
166
186
|
userId,
|
|
167
187
|
});
|
|
@@ -169,6 +189,10 @@ export const useRestorePurchase = (userId: string | undefined) => {
|
|
|
169
189
|
const success = await SubscriptionManager.restore();
|
|
170
190
|
|
|
171
191
|
if (success) {
|
|
192
|
+
trackPackageEvent("subscription", "restore_success", {
|
|
193
|
+
userId,
|
|
194
|
+
});
|
|
195
|
+
|
|
172
196
|
addPackageBreadcrumb("subscription", "Restore mutation success", {
|
|
173
197
|
userId,
|
|
174
198
|
});
|