-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathNativeQonversionModule.ts
More file actions
74 lines (70 loc) · 3.4 KB
/
NativeQonversionModule.ts
File metadata and controls
74 lines (70 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import type {TurboModule} from 'react-native';
import {TurboModuleRegistry} from 'react-native';
import type { QPromotionalOffer, QOfferings, QUser, QUserProperties, QRemoteConfig, QRemoteConfigList } from '../Mapper';
import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
export type QPromoOfferDetails = {
productDiscountId: string | undefined,
keyIdentifier: string | undefined,
nonce: string | undefined,
signature: string | undefined,
timestamp: number | undefined,
}
export interface Spec extends TurboModule {
storeSDKInfo(sdkName: string, sdkVersion: string): void;
initializeSdk(
projectKey: string,
launchMode: string,
environment: string,
entitlementsCacheLifetime: string,
proxyUrl: string | undefined,
kidsMode: boolean
): void;
syncHistoricalData(): void;
syncStoreKit2Purchases(): void;
isFallbackFileAccessible(): Promise<{success: boolean}>;
getPromotionalOffer(product: string, discount: string | undefined): Promise<QPromotionalOffer | null>;
purchase(
productId: string,
quantity: number, // iOS only
contextKeys: string[] | null | undefined,
promoOffer: QPromoOfferDetails | undefined, // iOS only
offerId: string | null | undefined, // Android only
applyOffer: boolean, // Android only
oldProductId: string | null | undefined, // Android only
updatePolicyKey: string | null | undefined, // Android only
): Promise<Object | null | undefined>; // Record<string, QEntitlement
updatePurchase(
productId: string,
offerId: string | null | undefined,
applyOffer: boolean,
oldProductId: string | null | undefined,
updatePolicyKey: string | null | undefined,
): Promise<Object>; // Android only // Record<string, QEntitlement>
promoPurchase(productId: string): Promise<Object>; // iOS only / Record<string, QEntitlement
products(): Promise<Object>; // Record<string, QProduct
offerings(): Promise<QOfferings | null>;
checkTrialIntroEligibilityForProductIds(ids: string[]): Promise<Object>; // Record<string, QEligibilityInfo>
checkEntitlements(): Promise<Object>; // Record<string, QEntitlement>
restore(): Promise<Object>; // Record<string, QEntitlement>
syncPurchases(): void;
identify(userId: string): Promise<QUser>;
logout(): void;
userInfo(): Promise<QUser>;
addAttributionData(data: Object, provider: string): void;
setDefinedProperty(property: string, value: string): void;
setCustomProperty(property: string, value: string): void;
userProperties(): Promise<QUserProperties>;
collectAdvertisingId(): void; // iOS only
collectAppleSearchAdsAttribution(): void; // iOS only
presentCodeRedemptionSheet(): void; // iOS only
remoteConfig(contextKey: string | undefined): Promise<QRemoteConfig>;
remoteConfigList(): Promise<QRemoteConfigList>;
remoteConfigListForContextKeys(contextKeys: string[], includeEmptyContextKey: boolean): Promise<QRemoteConfigList>;
attachUserToExperiment(experimentId: string, groupId: string): Promise<void>;
detachUserFromExperiment(experimentId: string): Promise<void>;
attachUserToRemoteConfiguration(remoteConfigurationId: string): Promise<void>;
detachUserFromRemoteConfiguration(remoteConfigurationId: string): Promise<void>;
readonly onEntitlementsUpdated: EventEmitter<Object>; // Record<string, QEntitlement>
readonly onPromoPurchaseReceived: EventEmitter<string>;
}
export default TurboModuleRegistry.getEnforcing<Spec>('RNQonversion');