@tryheliumai/paywall-sdk-react-native 0.2.22 → 3.0.5
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 +163 -76
- package/ios/RCTHeliumBridge.m +5 -0
- package/lib/commonjs/handlers/revenuecat.js +7 -3
- package/lib/commonjs/handlers/revenuecat.js.map +1 -1
- package/lib/commonjs/index.js +2 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/native-interface.js +133 -182
- 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 +8 -3
- 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 +132 -178
- 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 +3 -21
- package/lib/typescript/commonjs/src/native-interface.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types.d.ts +107 -6
- 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 +3 -21
- package/lib/typescript/module/src/native-interface.d.ts.map +1 -1
- package/lib/typescript/module/src/types.d.ts +107 -6
- package/lib/typescript/module/src/types.d.ts.map +1 -1
- package/package.json +1 -9
- package/src/handlers/revenuecat.ts +7 -3
- package/src/index.ts +10 -3
- package/src/native-interface.tsx +172 -191
- package/src/types.ts +147 -9
|
@@ -11,12 +11,12 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.license = package["license"]
|
|
12
12
|
s.authors = package["author"]
|
|
13
13
|
|
|
14
|
-
s.platforms = { :ios => "
|
|
14
|
+
s.platforms = { :ios => "15.0" }
|
|
15
15
|
s.source = { :git => "https://github.com/cloudcaptainai/helium-react-native-sdk.git", :tag => "#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
|
-
s.dependency 'Helium', '
|
|
19
|
+
s.dependency 'Helium', '3.0.5'
|
|
20
20
|
|
|
21
21
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
22
22
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
@@ -138,14 +138,27 @@ class BridgingPaywallDelegate: HeliumPaywallDelegate {
|
|
|
138
138
|
error: nil
|
|
139
139
|
))
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
func
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
|
|
142
|
+
func onPaywallEvent(_ event: any HeliumEvent) {
|
|
143
|
+
var eventDict = event.toDictionary()
|
|
144
|
+
// Add deprecated fields for backwards compatibility
|
|
145
|
+
if let paywallName = eventDict["paywallName"] {
|
|
146
|
+
eventDict["paywallTemplateName"] = paywallName
|
|
147
|
+
}
|
|
148
|
+
if let error = eventDict["error"] {
|
|
149
|
+
eventDict["errorDescription"] = error
|
|
150
|
+
}
|
|
151
|
+
if let productId = eventDict["productId"] {
|
|
152
|
+
eventDict["productKey"] = productId
|
|
153
|
+
}
|
|
154
|
+
if let buttonName = eventDict["buttonName"] {
|
|
155
|
+
eventDict["ctaName"] = buttonName
|
|
156
|
+
}
|
|
157
|
+
bridge?.sendEvent(
|
|
158
|
+
withName: "helium_paywall_event",
|
|
159
|
+
body: eventDict
|
|
160
|
+
)
|
|
161
|
+
}
|
|
149
162
|
|
|
150
163
|
func getCustomVariableValues() -> [String: Any?] {
|
|
151
164
|
return [:];
|
|
@@ -169,7 +182,8 @@ class HeliumBridge: RCTEventEmitter {
|
|
|
169
182
|
"helium_make_purchase",
|
|
170
183
|
"helium_restore_purchases",
|
|
171
184
|
"helium_download_state_changed",
|
|
172
|
-
"helium_fallback_visibility"
|
|
185
|
+
"helium_fallback_visibility",
|
|
186
|
+
"paywallEventHandlers"
|
|
173
187
|
]
|
|
174
188
|
}
|
|
175
189
|
|
|
@@ -183,89 +197,92 @@ class HeliumBridge: RCTEventEmitter {
|
|
|
183
197
|
_ config: NSDictionary,
|
|
184
198
|
customVariableValues: NSDictionary
|
|
185
199
|
) {
|
|
186
|
-
guard let apiKey = config["apiKey"] as? String
|
|
187
|
-
let viewTag = config["fallbackPaywall"] as? NSNumber else {
|
|
200
|
+
guard let apiKey = config["apiKey"] as? String else {
|
|
188
201
|
return
|
|
189
202
|
}
|
|
190
203
|
|
|
191
|
-
let triggers = config["triggers"] as? [String]
|
|
192
204
|
let customUserId = config["customUserId"] as? String
|
|
193
205
|
let customAPIEndpoint = config["customAPIEndpoint"] as? String
|
|
194
|
-
let customUserTraits = config["customUserTraits"] as? [String: Any]
|
|
206
|
+
let customUserTraits = convertMarkersToBooleans(config["customUserTraits"] as? [String: Any])
|
|
195
207
|
let revenueCatAppUserId = config["revenueCatAppUserId"] as? String
|
|
196
|
-
let fallbackPaywallPerTriggerTags = config["fallbackPaywallPerTrigger"] as? [String: NSNumber]
|
|
197
208
|
let fallbackBundleURLString = config["fallbackBundleUrlString"] as? String
|
|
198
209
|
let fallbackBundleString = config["fallbackBundleString"] as? String
|
|
199
210
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
211
|
+
let paywallLoadingConfig = convertMarkersToBooleans(config["paywallLoadingConfig"] as? [String: Any])
|
|
212
|
+
let useLoadingState = paywallLoadingConfig?["useLoadingState"] as? Bool ?? true
|
|
213
|
+
let loadingBudget = paywallLoadingConfig?["loadingBudget"] as? TimeInterval ?? 2.0
|
|
214
|
+
|
|
215
|
+
var perTriggerLoadingConfig: [String: TriggerLoadingConfig]? = nil
|
|
216
|
+
if let perTriggerDict = paywallLoadingConfig?["perTriggerLoadingConfig"] as? [String: [String: Any]] {
|
|
217
|
+
var triggerConfigs: [String: TriggerLoadingConfig] = [:]
|
|
218
|
+
for (trigger, config) in perTriggerDict {
|
|
219
|
+
triggerConfigs[trigger] = TriggerLoadingConfig(
|
|
220
|
+
useLoadingState: config["useLoadingState"] as? Bool,
|
|
221
|
+
loadingBudget: config["loadingBudget"] as? TimeInterval
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
perTriggerLoadingConfig = triggerConfigs
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
let useDefaultDelegate = config["useDefaultDelegate"] as? Bool ?? false
|
|
203
228
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
229
|
+
let delegateEventHandler: (HeliumEvent) -> Void = { [weak self] event in
|
|
230
|
+
var eventDict = event.toDictionary()
|
|
231
|
+
// Add deprecated fields for backwards compatibility
|
|
232
|
+
if let paywallName = eventDict["paywallName"] {
|
|
233
|
+
eventDict["paywallTemplateName"] = paywallName
|
|
234
|
+
}
|
|
235
|
+
if let error = eventDict["error"] {
|
|
236
|
+
eventDict["errorDescription"] = error
|
|
211
237
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
let wrappedView = UIViewWrapper(view: fallbackPaywall)
|
|
215
|
-
|
|
216
|
-
// Process fallbackPaywallPerTrigger if provided
|
|
217
|
-
var triggerViewsMap: [String: any View]? = nil
|
|
218
|
-
|
|
219
|
-
if let fallbackPaywallPerTriggerTags = fallbackPaywallPerTriggerTags {
|
|
220
|
-
triggerViewsMap = [:]
|
|
221
|
-
|
|
222
|
-
for (trigger, tag) in fallbackPaywallPerTriggerTags {
|
|
223
|
-
if let view = bridge.uiManager.view(forReactTag: tag) {
|
|
224
|
-
// Initially hide trigger-specific fallback views
|
|
225
|
-
triggerViewsMap?[trigger] = UIViewWrapper(view: view)
|
|
226
|
-
} else {
|
|
227
|
-
}
|
|
228
|
-
}
|
|
238
|
+
if let productId = eventDict["productId"] {
|
|
239
|
+
eventDict["productKey"] = productId
|
|
229
240
|
}
|
|
241
|
+
if let buttonName = eventDict["buttonName"] {
|
|
242
|
+
eventDict["ctaName"] = buttonName
|
|
243
|
+
}
|
|
244
|
+
self?.sendEvent(
|
|
245
|
+
withName: "helium_paywall_event",
|
|
246
|
+
body: eventDict
|
|
247
|
+
)
|
|
248
|
+
}
|
|
230
249
|
|
|
231
|
-
|
|
232
|
-
|
|
250
|
+
self.bridgingDelegate = BridgingPaywallDelegate(
|
|
251
|
+
bridge: self
|
|
252
|
+
)
|
|
233
253
|
|
|
234
|
-
|
|
235
|
-
fallbackBundleURL = URL(string: urlString)
|
|
236
|
-
} else if let jsonString = fallbackBundleString {
|
|
237
|
-
// expo-file-system wasn't available, write the string to a temp file
|
|
238
|
-
let tempURL = FileManager.default.temporaryDirectory
|
|
239
|
-
.appendingPathComponent("helium-fallback.json")
|
|
254
|
+
let defaultDelegate = DefaultPurchaseDelegate(eventHandler: delegateEventHandler)
|
|
240
255
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
fallbackBundleURL = tempURL
|
|
244
|
-
}
|
|
245
|
-
}
|
|
256
|
+
// Handle fallback bundle - either as URL string or JSON string
|
|
257
|
+
var fallbackBundleURL: URL? = nil
|
|
246
258
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
triggers: triggers,
|
|
258
|
-
customUserId: customUserId,
|
|
259
|
-
customAPIEndpoint: customAPIEndpoint,
|
|
260
|
-
customUserTraits: HeliumUserTraits(customUserTraits ?? [:]),
|
|
261
|
-
revenueCatAppUserId: revenueCatAppUserId,
|
|
262
|
-
fallbackBundleURL: fallbackBundleURL,
|
|
263
|
-
fallbackPaywallPerTrigger: triggerViewsMap
|
|
264
|
-
)
|
|
265
|
-
|
|
266
|
-
let initTime = CFAbsoluteTimeGetCurrent() - initStartTime
|
|
259
|
+
if let urlString = fallbackBundleURLString {
|
|
260
|
+
fallbackBundleURL = URL(string: urlString)
|
|
261
|
+
} else if let jsonString = fallbackBundleString {
|
|
262
|
+
// expo-file-system wasn't available, write the string to a temp file
|
|
263
|
+
let tempURL = FileManager.default.temporaryDirectory
|
|
264
|
+
.appendingPathComponent("helium-fallback.json")
|
|
265
|
+
|
|
266
|
+
if let data = jsonString.data(using: .utf8) {
|
|
267
|
+
try? data.write(to: tempURL)
|
|
268
|
+
fallbackBundleURL = tempURL
|
|
267
269
|
}
|
|
268
270
|
}
|
|
271
|
+
|
|
272
|
+
Helium.shared.initialize(
|
|
273
|
+
apiKey: apiKey,
|
|
274
|
+
heliumPaywallDelegate: useDefaultDelegate ? defaultDelegate : self.bridgingDelegate!,
|
|
275
|
+
fallbackConfig: HeliumFallbackConfig.withMultipleFallbacks(
|
|
276
|
+
fallbackBundle: fallbackBundleURL,
|
|
277
|
+
useLoadingState: useLoadingState,
|
|
278
|
+
loadingBudget: loadingBudget,
|
|
279
|
+
perTriggerLoadingConfig: perTriggerLoadingConfig
|
|
280
|
+
),
|
|
281
|
+
customUserId: customUserId,
|
|
282
|
+
customAPIEndpoint: customAPIEndpoint,
|
|
283
|
+
customUserTraits: HeliumUserTraits(customUserTraits ?? [:]),
|
|
284
|
+
revenueCatAppUserId: revenueCatAppUserId
|
|
285
|
+
)
|
|
269
286
|
}
|
|
270
287
|
|
|
271
288
|
@objc
|
|
@@ -297,9 +314,27 @@ class HeliumBridge: RCTEventEmitter {
|
|
|
297
314
|
|
|
298
315
|
@objc
|
|
299
316
|
public func presentUpsell(
|
|
300
|
-
_ trigger: String
|
|
317
|
+
_ trigger: String,
|
|
318
|
+
customPaywallTraits: [String: Any]?
|
|
301
319
|
) {
|
|
302
|
-
Helium.shared.presentUpsell(
|
|
320
|
+
Helium.shared.presentUpsell(
|
|
321
|
+
trigger: trigger,
|
|
322
|
+
eventHandlers: PaywallEventHandlers.withHandlers(
|
|
323
|
+
onOpen: { [weak self] event in
|
|
324
|
+
self?.sendEvent(withName: "paywallEventHandlers", body: event.toDictionary())
|
|
325
|
+
},
|
|
326
|
+
onClose: { [weak self] event in
|
|
327
|
+
self?.sendEvent(withName: "paywallEventHandlers", body: event.toDictionary())
|
|
328
|
+
},
|
|
329
|
+
onDismissed: { [weak self] event in
|
|
330
|
+
self?.sendEvent(withName: "paywallEventHandlers", body: event.toDictionary())
|
|
331
|
+
},
|
|
332
|
+
onPurchaseSucceeded: { [weak self] event in
|
|
333
|
+
self?.sendEvent(withName: "paywallEventHandlers", body: event.toDictionary())
|
|
334
|
+
}
|
|
335
|
+
),
|
|
336
|
+
customPaywallTraits: convertMarkersToBooleans(customPaywallTraits)
|
|
337
|
+
);
|
|
303
338
|
}
|
|
304
339
|
|
|
305
340
|
@objc
|
|
@@ -363,10 +398,17 @@ class HeliumBridge: RCTEventEmitter {
|
|
|
363
398
|
let canPresent: Bool
|
|
364
399
|
let reason: String
|
|
365
400
|
|
|
401
|
+
let useLoading = Helium.shared.loadingStateEnabledFor(trigger: trigger)
|
|
402
|
+
let downloadInProgress = Helium.shared.getDownloadStatus() == .inProgress
|
|
403
|
+
|
|
366
404
|
if paywallsLoaded && hasTrigger {
|
|
367
405
|
// Normal case - paywall is ready
|
|
368
406
|
canPresent = true
|
|
369
407
|
reason = "ready"
|
|
408
|
+
} else if downloadInProgress && useLoading {
|
|
409
|
+
// Loading case - paywall still downloading
|
|
410
|
+
canPresent = true
|
|
411
|
+
reason = "loading"
|
|
370
412
|
} else if HeliumFallbackViewManager.shared.getFallbackInfo(trigger: trigger) != nil {
|
|
371
413
|
// Fallback is available (via downloaded bundle)
|
|
372
414
|
canPresent = true
|
|
@@ -380,4 +422,49 @@ class HeliumBridge: RCTEventEmitter {
|
|
|
380
422
|
callback([canPresent, reason])
|
|
381
423
|
}
|
|
382
424
|
|
|
425
|
+
@objc
|
|
426
|
+
public func setRevenueCatAppUserId(_ rcAppUserId: String) {
|
|
427
|
+
Helium.shared.setRevenueCatAppUserId(rcAppUserId)
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
private func convertMarkersToBooleans(_ input: [String: Any]?) -> [String: Any]? {
|
|
431
|
+
guard let input = input else { return nil }
|
|
432
|
+
|
|
433
|
+
var result: [String: Any] = [:]
|
|
434
|
+
for (key, value) in input {
|
|
435
|
+
result[key] = convertValueMarkersToBooleans(value)
|
|
436
|
+
}
|
|
437
|
+
return result
|
|
438
|
+
}
|
|
439
|
+
private func convertValueMarkersToBooleans(_ value: Any) -> Any {
|
|
440
|
+
if let stringValue = value as? String {
|
|
441
|
+
switch stringValue {
|
|
442
|
+
case "__helium_rn_bool_true__":
|
|
443
|
+
return true
|
|
444
|
+
case "__helium_rn_bool_false__":
|
|
445
|
+
return false
|
|
446
|
+
default:
|
|
447
|
+
return stringValue
|
|
448
|
+
}
|
|
449
|
+
} else if let dictValue = value as? [String: Any] {
|
|
450
|
+
return convertMarkersToBooleans(dictValue) ?? [:]
|
|
451
|
+
} else if let arrayValue = value as? [Any] {
|
|
452
|
+
return arrayValue.map { convertValueMarkersToBooleans($0) }
|
|
453
|
+
}
|
|
454
|
+
return value
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
fileprivate class DefaultPurchaseDelegate: StoreKitDelegate {
|
|
460
|
+
private let eventHandler: (HeliumEvent) -> Void
|
|
461
|
+
init(
|
|
462
|
+
eventHandler: @escaping (HeliumEvent) -> Void
|
|
463
|
+
) {
|
|
464
|
+
self.eventHandler = eventHandler
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
override func onPaywallEvent(_ event: any HeliumEvent) {
|
|
468
|
+
eventHandler(event)
|
|
469
|
+
}
|
|
383
470
|
}
|
package/ios/RCTHeliumBridge.m
CHANGED
|
@@ -18,6 +18,7 @@ RCT_EXTERN_METHOD(
|
|
|
18
18
|
|
|
19
19
|
RCT_EXTERN_METHOD(
|
|
20
20
|
presentUpsell:(NSString *)trigger
|
|
21
|
+
customPaywallTraits:(NSDictionary *)customPaywallTraits
|
|
21
22
|
)
|
|
22
23
|
|
|
23
24
|
RCT_EXTERN_METHOD(
|
|
@@ -61,4 +62,8 @@ RCT_EXTERN_METHOD(
|
|
|
61
62
|
callback:(RCTResponseSenderBlock)callback
|
|
62
63
|
)
|
|
63
64
|
|
|
65
|
+
RCT_EXTERN_METHOD(
|
|
66
|
+
setRevenueCatAppUserId:(NSString *)rcAppUserId
|
|
67
|
+
)
|
|
68
|
+
|
|
64
69
|
@end
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.RevenueCatHeliumHandler = void 0;
|
|
7
7
|
exports.createRevenueCatPurchaseConfig = createRevenueCatPurchaseConfig;
|
|
8
8
|
var _reactNativePurchases = _interopRequireWildcard(require("react-native-purchases"));
|
|
9
|
+
var _paywallSdkReactNative = require("@tryheliumai/paywall-sdk-react-native");
|
|
9
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
10
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
12
|
// Rename the factory function
|
|
12
13
|
function createRevenueCatPurchaseConfig(config) {
|
|
13
14
|
const rcHandler = new RevenueCatHeliumHandler(config?.apiKey);
|
|
14
15
|
return {
|
|
15
|
-
apiKey: config?.apiKey,
|
|
16
16
|
makePurchase: rcHandler.makePurchase.bind(rcHandler),
|
|
17
17
|
restorePurchases: rcHandler.restorePurchases.bind(rcHandler)
|
|
18
18
|
};
|
|
@@ -27,8 +27,8 @@ class RevenueCatHeliumHandler {
|
|
|
27
27
|
_reactNativePurchases.default.configure({
|
|
28
28
|
apiKey
|
|
29
29
|
});
|
|
30
|
-
}
|
|
31
|
-
this.initializePackageMapping();
|
|
30
|
+
}
|
|
31
|
+
void this.initializePackageMapping();
|
|
32
32
|
}
|
|
33
33
|
async initializePackageMapping() {
|
|
34
34
|
if (this.initializationPromise) {
|
|
@@ -36,6 +36,8 @@ class RevenueCatHeliumHandler {
|
|
|
36
36
|
}
|
|
37
37
|
this.initializationPromise = (async () => {
|
|
38
38
|
try {
|
|
39
|
+
// Keep this value as up-to-date as possible
|
|
40
|
+
(0, _paywallSdkReactNative.setRevenueCatAppUserId)(await _reactNativePurchases.default.getAppUserID());
|
|
39
41
|
const offerings = await _reactNativePurchases.default.getOfferings();
|
|
40
42
|
const allOfferings = offerings.all;
|
|
41
43
|
for (const offering of Object.values(allOfferings)) {
|
|
@@ -63,6 +65,8 @@ class RevenueCatHeliumHandler {
|
|
|
63
65
|
}
|
|
64
66
|
async makePurchase(productId) {
|
|
65
67
|
await this.ensureMappingInitialized();
|
|
68
|
+
// Keep this value as up-to-date as possible
|
|
69
|
+
(0, _paywallSdkReactNative.setRevenueCatAppUserId)(await _reactNativePurchases.default.getAppUserID());
|
|
66
70
|
const pkg = this.productIdToPackageMapping[productId];
|
|
67
71
|
let rcProduct;
|
|
68
72
|
if (!pkg) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativePurchases","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","createRevenueCatPurchaseConfig","config","rcHandler","RevenueCatHeliumHandler","apiKey","makePurchase","bind","restorePurchases","productIdToPackageMapping","isMappingInitialized","initializationPromise","rcProductToPackageMapping","constructor","Purchases","configure","initializePackageMapping","offerings","getOfferings","allOfferings","all","offering","values","availablePackages","forEach","pkg","product","identifier","error","ensureMappingInitialized","productId","rcProduct","rcProducts","getProducts","length","undefined","customerInfo","purchasePackage","purchaseStoreProduct","status","isActive","isProductActive","purchasesError","code","PURCHASES_ERROR_CODE","PAYMENT_PENDING_ERROR","Promise","resolve","updateListener","updatedCustomerInfo","clearTimeout","timeoutId","removeCustomerInfoUpdateListener","setTimeout","addCustomerInfoUpdateListener","PURCHASE_CANCELLED_ERROR","message","entitlements","active","some","entitlement","productIdentifier","activeSubscriptions","includes","allPurchasedProductIdentifiers","keys","exports"],"sourceRoot":"../../../src","sources":["handlers/revenuecat.ts"],"mappings":";;;;;;;AAAA,IAAAA,qBAAA,GAAAC,uBAAA,CAAAC,OAAA;
|
|
1
|
+
{"version":3,"names":["_reactNativePurchases","_interopRequireWildcard","require","_paywallSdkReactNative","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","createRevenueCatPurchaseConfig","config","rcHandler","RevenueCatHeliumHandler","apiKey","makePurchase","bind","restorePurchases","productIdToPackageMapping","isMappingInitialized","initializationPromise","rcProductToPackageMapping","constructor","Purchases","configure","initializePackageMapping","setRevenueCatAppUserId","getAppUserID","offerings","getOfferings","allOfferings","all","offering","values","availablePackages","forEach","pkg","product","identifier","error","ensureMappingInitialized","productId","rcProduct","rcProducts","getProducts","length","undefined","customerInfo","purchasePackage","purchaseStoreProduct","status","isActive","isProductActive","purchasesError","code","PURCHASES_ERROR_CODE","PAYMENT_PENDING_ERROR","Promise","resolve","updateListener","updatedCustomerInfo","clearTimeout","timeoutId","removeCustomerInfoUpdateListener","setTimeout","addCustomerInfoUpdateListener","PURCHASE_CANCELLED_ERROR","message","entitlements","active","some","entitlement","productIdentifier","activeSubscriptions","includes","allPurchasedProductIdentifiers","keys","exports"],"sourceRoot":"../../../src","sources":["handlers/revenuecat.ts"],"mappings":";;;;;;;AAAA,IAAAA,qBAAA,GAAAC,uBAAA,CAAAC,OAAA;AAYA,IAAAC,sBAAA,GAAAD,OAAA;AAA+E,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAA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;IACnB,CAAC,CAAC,OAAOZ,KAAK,EAAE;MACZ,OAAO,KAAK;IAChB;EACJ;AACJ;AAACsC,OAAA,CAAAhE,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -9,24 +9,12 @@ Object.defineProperty(exports, "HELIUM_CTA_NAMES", {
|
|
|
9
9
|
return _nativeInterface.HELIUM_CTA_NAMES;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "HeliumProvider", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _nativeInterface.HeliumProvider;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
Object.defineProperty(exports, "NativeHeliumUpsellView", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
21
15
|
return _nativeInterface.NativeHeliumUpsellView;
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
|
-
Object.defineProperty(exports, "UpsellView", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _nativeInterface.UpsellView;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
18
|
Object.defineProperty(exports, "createCustomPurchaseConfig", {
|
|
31
19
|
enumerable: true,
|
|
32
20
|
get: function () {
|
|
@@ -69,10 +57,10 @@ Object.defineProperty(exports, "presentUpsell", {
|
|
|
69
57
|
return _nativeInterface.presentUpsell;
|
|
70
58
|
}
|
|
71
59
|
});
|
|
72
|
-
Object.defineProperty(exports, "
|
|
60
|
+
Object.defineProperty(exports, "setRevenueCatAppUserId", {
|
|
73
61
|
enumerable: true,
|
|
74
62
|
get: function () {
|
|
75
|
-
return _nativeInterface.
|
|
63
|
+
return _nativeInterface.setRevenueCatAppUserId;
|
|
76
64
|
}
|
|
77
65
|
});
|
|
78
66
|
var _types = require("./types.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_types","require","_nativeInterface"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_types","require","_nativeInterface"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA","ignoreList":[]}
|