UNPKG

react-native-adapty

Version:
262 lines 8.33 kB
import { AdaptyUiMediaCache } from '../ui/types'; /** * Log levels for the SDK * * @remarks * Logging is performed on a native side. * So you are expected to watch logs in Xcode or Android Studio. */ export declare const LogLevel: Readonly<{ /** * Logs any additional information that may be useful during debugging, * such as function calls, API queries, etc. */ VERBOSE: "verbose"; /** * Logs only errors */ ERROR: "error"; /** * Logs messages from the SDK * that do not cause critical errors, * but are worth paying attention to */ WARN: "warn"; /** * Logs various information messages, * such as those that log the lifecycle of various modules */ INFO: "info"; }>; export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel]; export declare const FetchPolicy: Readonly<{ ReloadRevalidatingCacheData: "reload_revalidating_cache_data"; ReturnCacheDataElseLoad: "return_cache_data_else_load"; ReturnCacheDataIfNotExpiredElseLoad: "return_cache_data_if_not_expired_else_load"; }>; export type FetchPolicy = (typeof FetchPolicy)[keyof typeof FetchPolicy]; export type GetPlacementParamsInput = GetPlacementForDefaultAudienceParamsInput & { /** * This value limits the timeout (in milliseconds) for this method. * * @remarks * If the timeout is reached, cached data or local fallback will be returned. */ loadTimeoutMs?: number; }; export type GetPlacementForDefaultAudienceParamsInput = { /** * Fetch policy * * @remarks * By default SDK will try to load data from server and will return cached data in case of failure. * Otherwise use `'return_cache_data_else_load'` to return cached data if it exists. */ fetchPolicy?: Exclude<FetchPolicy, 'return_cache_data_if_not_expired_else_load'>; } | { /** * Fetch policy * * @remarks * By default SDK will try to load data from server and will return cached data in case of failure. * Otherwise use `'return_cache_data_else_load'` to return cached data if it exists. */ fetchPolicy: Extract<FetchPolicy, 'return_cache_data_if_not_expired_else_load'>; /** * Max age for cached data. * * @remarks * Max time (in seconds) the cache is valid in case of `'return_cache_data_if_not_expired_else_load'` fetch policy. */ maxAgeSeconds: number; }; /** * Describes optional parameters for the {@link activate} method. */ export interface ActivateParamsInput { /** * Turn it on if you handle purchases and subscription status yourself * and use Adapty for sending subscription events and analytics * * @defaultValue `false` */ observerMode?: boolean; /** * User identifier in your system * * @remarks * If none of the parameters are passed, the SDK will generate an ID * and use it for a current device. * Use your own ID: * 1. If you want to support a cross-device experience * 2. If you have your own authentication system, * and you want to associate adapty profile with your user */ customerUserId?: string; /** * Log level for the SDK * * @remarks * Logging is performed on a native side. * So you are expected to watch logs in Xcode or Android Studio. */ logLevel?: LogLevel; serverCluster?: 'default' | 'eu' | 'cn'; backendBaseUrl?: string; backendFallbackBaseUrl?: string; backendConfigsBaseUrl?: string; backendUABaseUrl?: string; backendProxyHost?: string; backendProxyPort?: number; activateUi?: boolean; mediaCache?: AdaptyUiMediaCache; /** * Locks methods threads until the SDK is ready. * @defaultValue `false` * @deprecated Turned on by default */ lockMethodsUntilReady?: boolean; /** * Does not activate SDK until any other method is called * Fixes annoying iOS simulator auhtentication */ __debugDeferActivation?: boolean; /** * Ignores multiple activation attempts on fast refresh. * If true, skips activation if SDK is already activated. */ __ignoreActivationOnFastRefresh?: boolean; /** * Disables IP address collection * @defaultValue `false` */ ipAddressCollectionDisabled?: boolean; ios?: { /** * Disables IDFA collection * @default false */ idfaCollectionDisabled?: boolean; }; android?: { /** * Disables Google AdvertisingID collection * @default false */ adIdCollectionDisabled?: boolean; }; } export interface GetPaywallProductsParamsInput { } export declare const AdaptyAndroidSubscriptionUpdateReplacementMode: Readonly<{ ChargeFullPrice: "charge_full_price"; Deferred: "deferred"; WithoutProration: "without_proration"; ChargeProratedPrice: "charge_prorated_price"; WithTimeProration: "with_time_proration"; }>; export type AdaptyAndroidSubscriptionUpdateReplacementMode = (typeof AdaptyAndroidSubscriptionUpdateReplacementMode)[keyof typeof AdaptyAndroidSubscriptionUpdateReplacementMode]; /** * Android purchase parameters structure * @public */ export interface AdaptyAndroidPurchaseParams { /** * Android subscription update parameters * @platform android */ subscriptionUpdateParams?: { oldSubVendorProductId: string; prorationMode: AdaptyAndroidSubscriptionUpdateReplacementMode; }; /** * Whether the offer is personalized * @platform android * @see {@link https://developer.android.com/google/play/billing/integrate#personalized-price} */ isOfferPersonalized?: boolean; /** * Obfuscated account ID * @platform android */ obfuscatedAccountId?: string; /** * Obfuscated profile ID * @platform android */ obfuscatedProfileId?: string; } export interface AdaptyAndroidSubscriptionUpdateParameters { oldSubVendorProductId: string; prorationMode: AdaptyAndroidSubscriptionUpdateReplacementMode; /** * @deprecated Use {@link AdaptyAndroidPurchaseParams.isOfferPersonalized} instead. * This field has been moved to the upper level in the new structure. * * @example * // OLD (deprecated): * android: { * oldSubVendorProductId: 'old_product_id', * prorationMode: 'charge_prorated_price', * isOfferPersonalized: true // This field is deprecated * } * * // NEW: * android: { * subscriptionUpdateParams: { * oldSubVendorProductId: 'old_product_id', * prorationMode: 'charge_prorated_price' * }, * isOfferPersonalized: true // Moved to upper level * } */ isOfferPersonalized?: boolean; } export type MakePurchaseParamsInput = { /** * Android purchase parameters * @platform android */ android?: AdaptyAndroidPurchaseParams; } | { /** * @deprecated Use the new parameter structure instead * * @example * // OLD (deprecated): * makePurchase(product, { * android: { * oldSubVendorProductId: 'old_product_id', * prorationMode: 'charge_prorated_price', * isOfferPersonalized: true * } * }); * * // NEW: * makePurchase(product, { * android: { * subscriptionUpdateParams: { * oldSubVendorProductId: 'old_product_id', * prorationMode: 'charge_prorated_price' * }, * isOfferPersonalized: true, // Note: moved to upper level * obfuscatedAccountId: 'account_123', * obfuscatedProfileId: 'profile_456' * } * }); * * @platform android */ android?: AdaptyAndroidSubscriptionUpdateParameters; }; export type FileLocation = { ios: { fileName: string; }; android: { relativeAssetPath: string; } | { rawResName: string; }; }; //# sourceMappingURL=inputs.d.ts.map