@tryheliumai/paywall-sdk-react-native 0.2.21 → 3.0.3
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/PaywallSdkReactNative.podspec +2 -2
- package/ios/HeliumSwiftInterface.swift +90 -77
- package/ios/RCTHeliumBridge.m +1 -0
- package/lib/commonjs/handlers/revenuecat.js +1 -1
- package/lib/commonjs/handlers/revenuecat.js.map +1 -1
- package/lib/commonjs/index.js +0 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-interface.js +81 -165
- package/lib/commonjs/native-interface.js.map +1 -1
- package/lib/commonjs/types.js +4 -0
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/handlers/revenuecat.js +1 -1
- package/lib/module/handlers/revenuecat.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/native-interface.js +81 -161
- package/lib/module/native-interface.js.map +1 -1
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/commonjs/src/handlers/revenuecat.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/native-interface.d.ts +2 -21
- package/lib/typescript/commonjs/src/native-interface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types.d.ts +102 -3
- package/lib/typescript/commonjs/src/types.d.ts.map +1 -1
- package/lib/typescript/module/src/handlers/revenuecat.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/native-interface.d.ts +2 -21
- package/lib/typescript/module/src/native-interface.d.ts.map +1 -1
- package/lib/typescript/module/src/types.d.ts +102 -3
- package/lib/typescript/module/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/handlers/revenuecat.ts +0 -1
- package/src/index.ts +9 -3
- package/src/native-interface.tsx +105 -172
- package/src/types.ts +142 -5
|
@@ -1,119 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import React, { createRef, useEffect, useState, createContext, useContext } from 'react';
|
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { NativeModules, NativeEventEmitter, requireNativeComponent } from 'react-native';
|
|
6
4
|
const {
|
|
7
5
|
HeliumBridge
|
|
8
6
|
} = NativeModules;
|
|
9
7
|
const heliumEventEmitter = new NativeEventEmitter(HeliumBridge);
|
|
10
8
|
|
|
11
9
|
// Register the native component once at module level
|
|
12
|
-
// This ensures it's only registered once, even during hot reloading
|
|
13
10
|
export const NativeHeliumUpsellView = requireNativeComponent('HeliumUpsellView');
|
|
14
|
-
|
|
11
|
+
|
|
15
12
|
// Add a flag to track if initialization has occurred
|
|
16
13
|
let isInitialized = false;
|
|
17
|
-
// Add a promise to track when the provider is mounted
|
|
18
|
-
let providerMountedPromise;
|
|
19
|
-
let resolveProviderMounted;
|
|
20
|
-
|
|
21
|
-
// Initialize the promise
|
|
22
|
-
providerMountedPromise = new Promise(resolve => {
|
|
23
|
-
resolveProviderMounted = resolve;
|
|
24
|
-
// If provider is already mounted, resolve immediately
|
|
25
|
-
if (isProviderMounted) {
|
|
26
|
-
resolve();
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
14
|
// Add module-level download status tracking
|
|
31
15
|
let globalDownloadStatus = 'notStarted';
|
|
32
16
|
export const getDownloadStatus = () => globalDownloadStatus;
|
|
33
|
-
|
|
34
|
-
// Create a context for the download status
|
|
35
|
-
|
|
36
|
-
const HeliumContext = /*#__PURE__*/createContext(undefined);
|
|
37
|
-
|
|
38
|
-
// Update the setter ref to also update global status
|
|
39
|
-
let setDownloadStatusRef = null;
|
|
40
17
|
const updateDownloadStatus = status => {
|
|
41
18
|
globalDownloadStatus = status;
|
|
42
|
-
setDownloadStatusRef?.(status);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// Hook to use the Helium context
|
|
46
|
-
export const useHelium = () => {
|
|
47
|
-
const context = useContext(HeliumContext);
|
|
48
|
-
if (!context) {
|
|
49
|
-
throw new Error('useHelium must be used within a HeliumProvider');
|
|
50
|
-
}
|
|
51
|
-
return context;
|
|
52
19
|
};
|
|
53
|
-
// Create a ref to store the fallback view reference
|
|
54
|
-
const fallbackRef = /*#__PURE__*/createRef();
|
|
55
|
-
// Store a reference to the fallback view component
|
|
56
|
-
let FallbackViewComponent = null;
|
|
57
|
-
|
|
58
|
-
// Provider component to be rendered at the app root
|
|
59
|
-
export const HeliumProvider = ({
|
|
60
|
-
children,
|
|
61
|
-
fallbackView
|
|
62
|
-
}) => {
|
|
63
|
-
// TODO - deprecate fallbackView (and maybe HeliumProvider too?)
|
|
64
|
-
if (fallbackView) {
|
|
65
|
-
console.warn('HeliumProvider: fallbackView is deprecated. Use onFallback passed to presentUpsell instead.');
|
|
66
|
-
}
|
|
67
|
-
const FallbackView = () => null;
|
|
68
|
-
// Add state for download status
|
|
69
|
-
const [downloadStatus, setDownloadStatus] = useState('notStarted');
|
|
70
|
-
|
|
71
|
-
// Store the setter in the ref so it can be accessed outside of components
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
setDownloadStatusRef = setDownloadStatus;
|
|
74
|
-
// Store the fallback view component for later use
|
|
75
|
-
FallbackViewComponent = FallbackView;
|
|
76
|
-
}, [setDownloadStatus, FallbackView]);
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
isProviderMounted = true;
|
|
79
|
-
// Resolve the promise when the provider is mounted
|
|
80
|
-
resolveProviderMounted();
|
|
81
|
-
return () => {
|
|
82
|
-
isProviderMounted = false;
|
|
83
|
-
setDownloadStatusRef = null;
|
|
84
|
-
};
|
|
85
|
-
}, []);
|
|
86
|
-
return /*#__PURE__*/_jsxs(HeliumContext.Provider, {
|
|
87
|
-
value: {
|
|
88
|
-
downloadStatus,
|
|
89
|
-
setDownloadStatus
|
|
90
|
-
},
|
|
91
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
92
|
-
ref: fallbackRef,
|
|
93
|
-
collapsable: false,
|
|
94
|
-
style: {
|
|
95
|
-
display: 'none'
|
|
96
|
-
},
|
|
97
|
-
children: /*#__PURE__*/_jsx(FallbackView, {})
|
|
98
|
-
}), children]
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
// Update initialize to accept full config
|
|
103
20
|
export const initialize = async config => {
|
|
104
21
|
// Early return if already initialized
|
|
105
22
|
if (isInitialized) {
|
|
23
|
+
console.log('[Helium] Already initialized, skipping...');
|
|
106
24
|
return;
|
|
107
25
|
}
|
|
108
|
-
|
|
109
|
-
// Wait for the provider to be mounted if it's not already
|
|
110
|
-
if (!isProviderMounted) {
|
|
111
|
-
await providerMountedPromise;
|
|
112
|
-
}
|
|
113
|
-
const viewTag = findNodeHandle(fallbackRef.current);
|
|
114
|
-
if (!viewTag) {
|
|
115
|
-
throw new Error('Failed to get fallback view reference. Make sure HeliumProvider is mounted with a fallback view.');
|
|
116
|
-
}
|
|
117
26
|
const purchaseHandler = {
|
|
118
27
|
makePurchase: config.purchaseConfig.makePurchase,
|
|
119
28
|
restorePurchases: config.purchaseConfig.restorePurchases
|
|
@@ -122,6 +31,12 @@ export const initialize = async config => {
|
|
|
122
31
|
// Update download status to inProgress
|
|
123
32
|
updateDownloadStatus('inProgress');
|
|
124
33
|
|
|
34
|
+
// Ensure these don't get added more than once
|
|
35
|
+
heliumEventEmitter.removeAllListeners('helium_paywall_event');
|
|
36
|
+
heliumEventEmitter.removeAllListeners('paywallEventHandlers');
|
|
37
|
+
heliumEventEmitter.removeAllListeners('helium_make_purchase');
|
|
38
|
+
heliumEventEmitter.removeAllListeners('helium_restore_purchases');
|
|
39
|
+
|
|
125
40
|
// Set up event listeners
|
|
126
41
|
heliumEventEmitter.addListener('helium_paywall_event', event => {
|
|
127
42
|
// Handle download status events
|
|
@@ -130,29 +45,16 @@ export const initialize = async config => {
|
|
|
130
45
|
} else if (event.type === 'paywallsDownloadError') {
|
|
131
46
|
updateDownloadStatus('failed');
|
|
132
47
|
}
|
|
133
|
-
// Handle fallback view visibility
|
|
134
|
-
else if (event.type === 'paywallOpen' && event.paywallTemplateName === 'Fallback') {
|
|
135
|
-
if (fallbackRef.current) {
|
|
136
|
-
fallbackRef.current.setNativeProps({
|
|
137
|
-
style: {
|
|
138
|
-
display: 'flex'
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
} else if (event.type === 'paywallClose' && event.paywallTemplateName === 'Fallback') {
|
|
143
|
-
if (fallbackRef.current) {
|
|
144
|
-
fallbackRef.current.setNativeProps({
|
|
145
|
-
style: {
|
|
146
|
-
display: 'none'
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
48
|
|
|
152
49
|
// Forward all events to the callback provided in config
|
|
153
50
|
config.onHeliumPaywallEvent(event);
|
|
154
51
|
});
|
|
155
52
|
|
|
53
|
+
// Set up paywall event handlers listener
|
|
54
|
+
heliumEventEmitter.addListener('paywallEventHandlers', event => {
|
|
55
|
+
callPaywallEventHandlers(event);
|
|
56
|
+
});
|
|
57
|
+
|
|
156
58
|
// Set up purchase event listener using the determined handler
|
|
157
59
|
heliumEventEmitter.addListener('helium_make_purchase', async event => {
|
|
158
60
|
const result = await purchaseHandler.makePurchase(event.productId);
|
|
@@ -189,24 +91,25 @@ export const initialize = async config => {
|
|
|
189
91
|
}
|
|
190
92
|
HeliumBridge.initialize({
|
|
191
93
|
apiKey: config.apiKey,
|
|
192
|
-
fallbackPaywall: viewTag,
|
|
193
|
-
triggers: config.triggers || [],
|
|
194
94
|
customUserId: config.customUserId || null,
|
|
195
95
|
customAPIEndpoint: config.customAPIEndpoint || null,
|
|
196
96
|
customUserTraits: config.customUserTraits == null ? {} : config.customUserTraits,
|
|
197
97
|
revenueCatAppUserId: config.revenueCatAppUserId,
|
|
198
98
|
fallbackBundleUrlString: fallbackBundleUrlString,
|
|
199
|
-
fallbackBundleString: fallbackBundleString
|
|
99
|
+
fallbackBundleString: fallbackBundleString,
|
|
100
|
+
paywallLoadingConfig: config.paywallLoadingConfig
|
|
200
101
|
}, {});
|
|
201
102
|
|
|
202
103
|
// Mark as initialized after successful initialization
|
|
203
104
|
isInitialized = true;
|
|
204
105
|
};
|
|
205
|
-
|
|
206
|
-
|
|
106
|
+
let paywallEventHandlers;
|
|
107
|
+
let presentOnFallback;
|
|
207
108
|
export const presentUpsell = ({
|
|
208
109
|
triggerName,
|
|
209
|
-
onFallback
|
|
110
|
+
onFallback,
|
|
111
|
+
eventHandlers,
|
|
112
|
+
customPaywallTraits
|
|
210
113
|
}) => {
|
|
211
114
|
HeliumBridge.canPresentUpsell(triggerName, (canPresent, reason) => {
|
|
212
115
|
if (!canPresent) {
|
|
@@ -216,14 +119,71 @@ export const presentUpsell = ({
|
|
|
216
119
|
return;
|
|
217
120
|
}
|
|
218
121
|
try {
|
|
219
|
-
|
|
122
|
+
paywallEventHandlers = eventHandlers;
|
|
123
|
+
presentOnFallback = onFallback;
|
|
124
|
+
HeliumBridge.presentUpsell(triggerName, customPaywallTraits || null);
|
|
220
125
|
} catch (error) {
|
|
221
126
|
console.log('[Helium] Present error', error);
|
|
127
|
+
paywallEventHandlers = undefined;
|
|
128
|
+
presentOnFallback = undefined;
|
|
222
129
|
onFallback?.();
|
|
223
130
|
HeliumBridge.fallbackOpenOrCloseEvent(triggerName, true, 'presented');
|
|
224
131
|
}
|
|
225
132
|
});
|
|
226
133
|
};
|
|
134
|
+
function callPaywallEventHandlers(event) {
|
|
135
|
+
if (paywallEventHandlers) {
|
|
136
|
+
switch (event.type) {
|
|
137
|
+
case 'paywallOpen':
|
|
138
|
+
paywallEventHandlers?.onOpen?.({
|
|
139
|
+
type: 'paywallOpen',
|
|
140
|
+
triggerName: event.triggerName ?? 'unknown',
|
|
141
|
+
paywallName: event.paywallName ?? 'unknown',
|
|
142
|
+
isSecondTry: event.isSecondTry ?? false,
|
|
143
|
+
viewType: 'presented'
|
|
144
|
+
});
|
|
145
|
+
break;
|
|
146
|
+
case 'paywallClose':
|
|
147
|
+
paywallEventHandlers?.onClose?.({
|
|
148
|
+
type: 'paywallClose',
|
|
149
|
+
triggerName: event.triggerName ?? 'unknown',
|
|
150
|
+
paywallName: event.paywallName ?? 'unknown',
|
|
151
|
+
isSecondTry: event.isSecondTry ?? false
|
|
152
|
+
});
|
|
153
|
+
if (!event.isSecondTry) {
|
|
154
|
+
paywallEventHandlers = undefined;
|
|
155
|
+
}
|
|
156
|
+
presentOnFallback = undefined;
|
|
157
|
+
break;
|
|
158
|
+
case 'paywallDismissed':
|
|
159
|
+
paywallEventHandlers?.onDismissed?.({
|
|
160
|
+
type: 'paywallDismissed',
|
|
161
|
+
triggerName: event.triggerName ?? 'unknown',
|
|
162
|
+
paywallName: event.paywallName ?? 'unknown',
|
|
163
|
+
isSecondTry: event.isSecondTry ?? false
|
|
164
|
+
});
|
|
165
|
+
break;
|
|
166
|
+
case 'purchaseSucceeded':
|
|
167
|
+
paywallEventHandlers?.onPurchaseSucceeded?.({
|
|
168
|
+
type: 'purchaseSucceeded',
|
|
169
|
+
productId: event.productId ?? 'unknown',
|
|
170
|
+
triggerName: event.triggerName ?? 'unknown',
|
|
171
|
+
paywallName: event.paywallName ?? 'unknown',
|
|
172
|
+
isSecondTry: event.isSecondTry ?? false
|
|
173
|
+
});
|
|
174
|
+
break;
|
|
175
|
+
case 'paywallSkipped':
|
|
176
|
+
paywallEventHandlers = undefined;
|
|
177
|
+
presentOnFallback = undefined;
|
|
178
|
+
break;
|
|
179
|
+
case 'paywallOpenFailed':
|
|
180
|
+
paywallEventHandlers = undefined;
|
|
181
|
+
presentOnFallback?.();
|
|
182
|
+
presentOnFallback = undefined;
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
227
187
|
export const hideUpsell = () => {
|
|
228
188
|
HeliumBridge.hideUpsell();
|
|
229
189
|
};
|
|
@@ -252,51 +212,11 @@ export const handleDeepLink = async url => {
|
|
|
252
212
|
console.log('[Helium] Handled deep link:', handled);
|
|
253
213
|
resolve(handled);
|
|
254
214
|
});
|
|
215
|
+
} else {
|
|
216
|
+
resolve(false);
|
|
255
217
|
}
|
|
256
218
|
});
|
|
257
219
|
};
|
|
258
|
-
|
|
259
|
-
// Update the UpsellView component to handle the style prop
|
|
260
|
-
export const UpsellView = ({
|
|
261
|
-
trigger,
|
|
262
|
-
fallbackViewProps,
|
|
263
|
-
fallbackViewWrapperStyles
|
|
264
|
-
}) => {
|
|
265
|
-
const {
|
|
266
|
-
downloadStatus
|
|
267
|
-
} = useHelium();
|
|
268
|
-
const showFallback = downloadStatus === 'notStarted' || downloadStatus === 'inProgress' || downloadStatus === 'failed';
|
|
269
|
-
useEffect(() => {
|
|
270
|
-
if (showFallback && FallbackViewComponent) {
|
|
271
|
-
HeliumBridge.fallbackOpenOrCloseEvent(trigger, true, 'embedded');
|
|
272
|
-
}
|
|
273
|
-
return () => {
|
|
274
|
-
if (showFallback && FallbackViewComponent) {
|
|
275
|
-
HeliumBridge.fallbackOpenOrCloseEvent(trigger, false, 'embedded');
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
}, [showFallback, trigger]);
|
|
279
|
-
|
|
280
|
-
// If download status is notStarted or inProgress, we haven't fully initialized yet
|
|
281
|
-
// In this case, we should render the fallback view
|
|
282
|
-
if (showFallback) {
|
|
283
|
-
// If we have a fallback view component, render it
|
|
284
|
-
if (FallbackViewComponent) {
|
|
285
|
-
return /*#__PURE__*/_jsx(View, {
|
|
286
|
-
style: fallbackViewWrapperStyles,
|
|
287
|
-
children: /*#__PURE__*/_jsx(FallbackViewComponent, {
|
|
288
|
-
...fallbackViewProps
|
|
289
|
-
})
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
return null;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// Use NativeHeliumUpsellView directly
|
|
296
|
-
return /*#__PURE__*/_jsx(NativeHeliumUpsellView, {
|
|
297
|
-
trigger: trigger
|
|
298
|
-
});
|
|
299
|
-
};
|
|
300
220
|
export const HELIUM_CTA_NAMES = {
|
|
301
221
|
SCHEDULE_CALL: 'schedule_call',
|
|
302
222
|
SUBSCRIBE_BUTTON: 'subscribe_button'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["NativeModules","NativeEventEmitter","requireNativeComponent","HeliumBridge","heliumEventEmitter","NativeHeliumUpsellView","isInitialized","globalDownloadStatus","getDownloadStatus","updateDownloadStatus","status","initialize","config","console","log","purchaseHandler","makePurchase","purchaseConfig","restorePurchases","removeAllListeners","addListener","event","type","onHeliumPaywallEvent","callPaywallEventHandlers","result","productId","handlePurchaseResponse","transactionId","error","success","handleRestoreResponse","fallbackBundleUrlString","fallbackBundleString","fallbackBundle","ExpoFileSystem","require","jsonContent","JSON","stringify","documentDirectory","writeAsStringAsync","apiKey","customUserId","customAPIEndpoint","customUserTraits","revenueCatAppUserId","paywallLoadingConfig","paywallEventHandlers","presentOnFallback","presentUpsell","triggerName","onFallback","eventHandlers","customPaywallTraits","canPresentUpsell","canPresent","reason","fallbackOpenOrCloseEvent","undefined","onOpen","paywallName","isSecondTry","viewType","onClose","onDismissed","onPurchaseSucceeded","hideUpsell","hideAllUpsells","getPaywallInfo","trigger","Promise","resolve","templateName","shouldShow","paywallTemplateName","handleDeepLink","url","handled","HELIUM_CTA_NAMES","SCHEDULE_CALL","SUBSCRIBE_BUTTON"],"sourceRoot":"../../src","sources":["native-interface.tsx"],"mappings":";;AAAA,SACEA,aAAa,EACbC,kBAAkB,EAClBC,sBAAsB,QACjB,cAAc;AAWrB,MAAM;EAAEC;AAAa,CAAC,GAAGH,aAAa;AACtC,MAAMI,kBAAkB,GAAG,IAAIH,kBAAkB,CAACE,YAAY,CAAC;;AAE/D;AACA,OAAO,MAAME,sBAAsB,GACjCH,s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AgB,IAAK;QACrDjE,OAAO,CAACC,GAAG,CAAC,6BAA6B,EAAEgE,OAAO,CAAC;QACnDN,OAAO,CAACM,OAAO,CAAC;MAClB,CAAC,CAAC;IACJ,CAAC,MAAM;MACLN,OAAO,CAAC,KAAK,CAAC;IAChB;EACF,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMO,gBAAgB,GAAG;EAC9BC,aAAa,EAAE,eAAe;EAC9BC,gBAAgB,EAAE;AACpB,CAAC","ignoreList":[]}
|
package/lib/module/types.js
CHANGED
package/lib/module/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createCustomPurchaseConfig","callbacks","makePurchase","restorePurchases"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["createCustomPurchaseConfig","callbacks","makePurchase","restorePurchases"],"sourceRoot":"../../src","sources":["types.ts"],"mappings":";;AAgBA;;AAEA;;AAUA;AACA,OAAO,SAASA,0BAA0BA,CAACC,SAG1C,EAAwB;EACvB,OAAO;IACLC,YAAY,EAAED,SAAS,CAACC,YAAY;IACpCC,gBAAgB,EAAEF,SAAS,CAACE;EAC9B,CAAC;AACH;;AA+BA;;AAQA;;AA0FA;;AAoBA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revenuecat.d.ts","sourceRoot":"","sources":["../../../../../src/handlers/revenuecat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAU3E,wBAAgB,8BAA8B,CAAC,MAAM,CAAC,EAAE;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,oBAAoB,CAOvB;AAED,qBAAa,uBAAuB;IAChC,OAAO,CAAC,yBAAyB,CAAwC;IACzE,OAAO,CAAC,oBAAoB,CAAkB;IAC9C,OAAO,CAAC,qBAAqB,CAA8B;IAE3D,OAAO,CAAC,yBAAyB,CAA6C;gBAElE,MAAM,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"revenuecat.d.ts","sourceRoot":"","sources":["../../../../../src/handlers/revenuecat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAU3E,wBAAgB,8BAA8B,CAAC,MAAM,CAAC,EAAE;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,oBAAoB,CAOvB;AAED,qBAAa,uBAAuB;IAChC,OAAO,CAAC,yBAAyB,CAAwC;IACzE,OAAO,CAAC,oBAAoB,CAAkB;IAC9C,OAAO,CAAC,qBAAqB,CAA8B;IAE3D,OAAO,CAAC,yBAAyB,CAA6C;gBAElE,MAAM,CAAC,EAAE,MAAM;YAOb,wBAAwB;YAyBxB,wBAAwB;IAQhC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA+EpE,OAAO,CAAC,eAAe;IAMjB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;CAS7C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createCustomPurchaseConfig } from './types';
|
|
2
|
-
export {
|
|
3
|
-
export type { HeliumTransactionStatus, HeliumConfig, HeliumUpsellViewProps, } from './types';
|
|
2
|
+
export { initialize, presentUpsell, hideUpsell, hideAllUpsells, getPaywallInfo, handleDeepLink, HELIUM_CTA_NAMES, NativeHeliumUpsellView, } from './native-interface';
|
|
3
|
+
export type { HeliumTransactionStatus, HeliumConfig, HeliumUpsellViewProps, HeliumPaywallLoadingConfig, TriggerLoadingConfig, PaywallEventHandlers, PaywallOpenEvent, PaywallCloseEvent, PaywallDismissedEvent, PurchaseSucceededEvent, HeliumPaywallEvent, PresentUpsellParams, } from './types';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,uBAAuB,EACvB,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
@@ -1,33 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { HeliumConfig, HeliumUpsellViewProps, HeliumDownloadStatus, PaywallInfo } from './types';
|
|
1
|
+
import type { HeliumConfig, HeliumUpsellViewProps, HeliumDownloadStatus, PaywallInfo, PresentUpsellParams } from './types';
|
|
3
2
|
export declare const NativeHeliumUpsellView: import("react-native").HostComponent<HeliumUpsellViewProps>;
|
|
4
3
|
export declare const getDownloadStatus: () => HeliumDownloadStatus;
|
|
5
|
-
interface HeliumContextType {
|
|
6
|
-
downloadStatus: HeliumDownloadStatus;
|
|
7
|
-
setDownloadStatus: (status: HeliumDownloadStatus) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const useHelium: () => HeliumContextType;
|
|
10
|
-
interface HeliumProviderProps {
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
fallbackView?: React.ComponentType;
|
|
13
|
-
}
|
|
14
|
-
export declare const HeliumProvider: ({ children, fallbackView }: HeliumProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
4
|
export declare const initialize: (config: HeliumConfig) => Promise<void>;
|
|
16
|
-
export declare const presentUpsell: ({ triggerName, onFallback, }:
|
|
17
|
-
triggerName: string;
|
|
18
|
-
onFallback?: () => void;
|
|
19
|
-
}) => void;
|
|
5
|
+
export declare const presentUpsell: ({ triggerName, onFallback, eventHandlers, customPaywallTraits, }: PresentUpsellParams) => void;
|
|
20
6
|
export declare const hideUpsell: () => void;
|
|
21
7
|
export declare const hideAllUpsells: () => void;
|
|
22
8
|
export declare const getPaywallInfo: (trigger: string) => Promise<PaywallInfo | undefined>;
|
|
23
9
|
export declare const handleDeepLink: (url: string | null) => Promise<boolean>;
|
|
24
|
-
export declare const UpsellView: React.FC<HeliumUpsellViewProps & {
|
|
25
|
-
fallbackViewProps?: Record<string, any>;
|
|
26
|
-
fallbackViewWrapperStyles?: Record<string, any>;
|
|
27
|
-
}>;
|
|
28
10
|
export declare const HELIUM_CTA_NAMES: {
|
|
29
11
|
SCHEDULE_CALL: string;
|
|
30
12
|
SUBSCRIBE_BUTTON: string;
|
|
31
13
|
};
|
|
32
|
-
export {};
|
|
33
14
|
//# sourceMappingURL=native-interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native-interface.d.ts","sourceRoot":"","sources":["../../../../src/native-interface.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"native-interface.d.ts","sourceRoot":"","sources":["../../../../src/native-interface.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EAGpB,MAAM,SAAS,CAAC;AAMjB,eAAO,MAAM,sBAAsB,6DACgC,CAAC;AAMpE,eAAO,MAAM,iBAAiB,4BAA6B,CAAC;AAM5D,eAAO,MAAM,UAAU,WAAkB,YAAY,kBA8GpD,CAAC;AAIF,eAAO,MAAM,aAAa,qEAKvB,mBAAmB,SA0BrB,CAAC;AAwDF,eAAO,MAAM,UAAU,YAEtB,CAAC;AAEF,eAAO,MAAM,cAAc,YAE1B,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,MAAM,KACd,OAAO,CAAC,WAAW,GAAG,SAAS,CAiBjC,CAAC;AAEF,eAAO,MAAM,cAAc,QAAe,MAAM,GAAG,IAAI,KAAG,OAAO,CAAC,OAAO,CAWxE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC"}
|
|
@@ -15,16 +15,115 @@ export declare function createCustomPurchaseConfig(callbacks: {
|
|
|
15
15
|
makePurchase: (productId: string) => Promise<HeliumPurchaseResult>;
|
|
16
16
|
restorePurchases: () => Promise<boolean>;
|
|
17
17
|
}): HeliumPurchaseConfig;
|
|
18
|
+
export type TriggerLoadingConfig = {
|
|
19
|
+
/** Whether to show loading state for this trigger. Set to nil to use the global `useLoadingState` setting. */
|
|
20
|
+
useLoadingState?: boolean;
|
|
21
|
+
/** Maximum seconds to show loading for this trigger. Set to nil to use the global `loadingBudget` setting. */
|
|
22
|
+
loadingBudget?: number;
|
|
23
|
+
};
|
|
24
|
+
export type HeliumPaywallLoadingConfig = {
|
|
25
|
+
/**
|
|
26
|
+
* Whether to show a loading state while fetching paywall configuration.
|
|
27
|
+
* When true, shows a loading view for up to `loadingBudget` seconds before falling back.
|
|
28
|
+
* Default: true
|
|
29
|
+
*/
|
|
30
|
+
useLoadingState?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Maximum time (in seconds) to show the loading state before displaying fallback.
|
|
33
|
+
* After this timeout, the fallback view will be shown even if the paywall is still downloading.
|
|
34
|
+
* Default: 2.0 seconds
|
|
35
|
+
*/
|
|
36
|
+
loadingBudget?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Optional per-trigger loading configuration overrides.
|
|
39
|
+
* Use this to customize loading behavior for specific triggers.
|
|
40
|
+
* Keys are trigger names, values are TriggerLoadingConfig instances.
|
|
41
|
+
* Example: Disable loading for "onboarding" trigger while keeping it for others.
|
|
42
|
+
*/
|
|
43
|
+
perTriggerLoadingConfig?: Record<string, TriggerLoadingConfig>;
|
|
44
|
+
};
|
|
45
|
+
export interface PaywallEventHandlers {
|
|
46
|
+
onOpen?: (event: PaywallOpenEvent) => void;
|
|
47
|
+
onClose?: (event: PaywallCloseEvent) => void;
|
|
48
|
+
onDismissed?: (event: PaywallDismissedEvent) => void;
|
|
49
|
+
onPurchaseSucceeded?: (event: PurchaseSucceededEvent) => void;
|
|
50
|
+
}
|
|
51
|
+
export interface PaywallOpenEvent {
|
|
52
|
+
type: 'paywallOpen';
|
|
53
|
+
triggerName: string;
|
|
54
|
+
paywallName: string;
|
|
55
|
+
isSecondTry: boolean;
|
|
56
|
+
viewType?: 'presented' | 'embedded' | 'triggered';
|
|
57
|
+
}
|
|
58
|
+
export interface PaywallCloseEvent {
|
|
59
|
+
type: 'paywallClose';
|
|
60
|
+
triggerName: string;
|
|
61
|
+
paywallName: string;
|
|
62
|
+
isSecondTry: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface PaywallDismissedEvent {
|
|
65
|
+
type: 'paywallDismissed';
|
|
66
|
+
triggerName: string;
|
|
67
|
+
paywallName: string;
|
|
68
|
+
isSecondTry: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface PurchaseSucceededEvent {
|
|
71
|
+
type: 'purchaseSucceeded';
|
|
72
|
+
productId: string;
|
|
73
|
+
triggerName: string;
|
|
74
|
+
paywallName: string;
|
|
75
|
+
isSecondTry: boolean;
|
|
76
|
+
}
|
|
77
|
+
export type HeliumPaywallEvent = {
|
|
78
|
+
type: 'paywallOpen' | 'paywallClose' | 'paywallDismissed' | 'paywallOpenFailed' | 'paywallSkipped' | 'paywallButtonPressed' | 'productSelected' | 'purchasePressed' | 'purchaseSucceeded' | 'purchaseCancelled' | 'purchaseFailed' | 'purchaseRestored' | 'purchaseRestoreFailed' | 'purchasePending' | 'initializeStart' | 'paywallsDownloadSuccess' | 'paywallsDownloadError' | 'paywallWebViewRendered';
|
|
79
|
+
triggerName?: string;
|
|
80
|
+
paywallName?: string;
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated Use `paywallName` instead.
|
|
83
|
+
*/
|
|
84
|
+
paywallTemplateName?: string;
|
|
85
|
+
productId?: string;
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Use `productId` instead.
|
|
88
|
+
*/
|
|
89
|
+
productKey?: string;
|
|
90
|
+
ctaName?: string;
|
|
91
|
+
paywallDownloadTimeTakenMS?: number;
|
|
92
|
+
templateDownloadTimeTakenMS?: number;
|
|
93
|
+
imagesDownloadTimeTakenMS?: number;
|
|
94
|
+
stylesDownloadTimeTakenMS?: number;
|
|
95
|
+
fontsDownloadTimeTakenMS?: number;
|
|
96
|
+
bundleDownloadTimeMS?: number;
|
|
97
|
+
dismissAll?: boolean;
|
|
98
|
+
isSecondTry?: boolean;
|
|
99
|
+
error?: string;
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated Use `error` instead.
|
|
102
|
+
*/
|
|
103
|
+
errorDescription?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Unix timestamp in seconds
|
|
106
|
+
*/
|
|
107
|
+
timestamp?: number;
|
|
108
|
+
};
|
|
109
|
+
export type PresentUpsellParams = {
|
|
110
|
+
triggerName: string;
|
|
111
|
+
/** Optional. This will be called when paywall fails to show due to an unsuccessful paywall download or if an invalid trigger is provided. */
|
|
112
|
+
onFallback?: () => void;
|
|
113
|
+
eventHandlers?: PaywallEventHandlers;
|
|
114
|
+
customPaywallTraits?: Record<string, any>;
|
|
115
|
+
};
|
|
18
116
|
export interface HeliumConfig {
|
|
19
117
|
/** Your Helium API Key */
|
|
20
118
|
apiKey: string;
|
|
21
119
|
/** Configuration for handling purchases. Can be custom functions or a pre-built handler config. */
|
|
22
120
|
purchaseConfig: HeliumPurchaseConfig;
|
|
23
121
|
/** Callback for receiving all Helium paywall events. */
|
|
24
|
-
onHeliumPaywallEvent: (event:
|
|
25
|
-
|
|
122
|
+
onHeliumPaywallEvent: (event: HeliumPaywallEvent) => void;
|
|
123
|
+
/** Fallback bundle in the rare situation that paywall is not ready to be shown. Highly recommended. See docs at https://docs.tryhelium.com/guides/fallback-bundle#react-native */
|
|
26
124
|
fallbackBundle?: object;
|
|
27
|
-
|
|
125
|
+
/** Configure loading behavior for paywalls that are mid-download. */
|
|
126
|
+
paywallLoadingConfig?: HeliumPaywallLoadingConfig;
|
|
28
127
|
customUserId?: string;
|
|
29
128
|
customAPIEndpoint?: string;
|
|
30
129
|
customUserTraits?: Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAC/B,WAAW,GACX,QAAQ,GACR,WAAW,GACX,SAAS,GACT,UAAU,CAAC;AACf,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,uBAAuB,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,QAAQ,GACR,YAAY,GACZ,YAAY,CAAC;AAIjB,8DAA8D;AAE9D,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnE,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAEzC,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,wBAAgB,0BAA0B,CAAC,SAAS,EAAE;IACpD,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACnE,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C,GAAG,oBAAoB,CAKvB;AAED,MAAM,MAA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AC9C,OAAO,CAAC,qBAAqB,CAA8B;IAE3D,OAAO,CAAC,yBAAyB,CAA6C;gBAElE,MAAM,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"revenuecat.d.ts","sourceRoot":"","sources":["../../../../../src/handlers/revenuecat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAU3E,wBAAgB,8BAA8B,CAAC,MAAM,CAAC,EAAE;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,oBAAoB,CAOvB;AAED,qBAAa,uBAAuB;IAChC,OAAO,CAAC,yBAAyB,CAAwC;IACzE,OAAO,CAAC,oBAAoB,CAAkB;IAC9C,OAAO,CAAC,qBAAqB,CAA8B;IAE3D,OAAO,CAAC,yBAAyB,CAA6C;gBAElE,MAAM,CAAC,EAAE,MAAM;YAOb,wBAAwB;YAyBxB,wBAAwB;IAQhC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA+EpE,OAAO,CAAC,eAAe;IAMjB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;CAS7C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { createCustomPurchaseConfig } from './types';
|
|
2
|
-
export {
|
|
3
|
-
export type { HeliumTransactionStatus, HeliumConfig, HeliumUpsellViewProps, } from './types';
|
|
2
|
+
export { initialize, presentUpsell, hideUpsell, hideAllUpsells, getPaywallInfo, handleDeepLink, HELIUM_CTA_NAMES, NativeHeliumUpsellView, } from './native-interface';
|
|
3
|
+
export type { HeliumTransactionStatus, HeliumConfig, HeliumUpsellViewProps, HeliumPaywallLoadingConfig, TriggerLoadingConfig, PaywallEventHandlers, PaywallOpenEvent, PaywallCloseEvent, PaywallDismissedEvent, PurchaseSucceededEvent, HeliumPaywallEvent, PresentUpsellParams, } from './types';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,uBAAuB,EACvB,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|