react-native-purchasely
Version:
Purchasely is a solution to ease the integration and boost your In-App Purchase & Subscriptions on the App Store, Google Play Store and Huawei App Gallery.
89 lines • 6.63 kB
TypeScript
import { PLYPresentationView } from './components/PLYPresentationView';
import type { Constants, DynamicOffering, FetchPresentationParameters, PresentPlanParameters, PresentPresentationParameters, PresentPresentationPlacementParameters, PresentPresentationWithIdentifierParameters, PresentProductParameters, PurchasePlanParameters, SignPromotionalOfferParameters, StartParameters, UserAttributesParameters } from './interfaces';
import { Attributes, LogLevels, PLYThemeMode } from './enums';
import type { PaywallActionInterceptorResult, PresentPresentationResult, PurchaselyEvent, PurchaselyPlan, PurchaselyPresentation, PurchaselyProduct, PurchaselyPromotionalOfferSignature, PurchaselySubscription, PurchaselyUserAttribute } from './types';
declare function setUserAttributeWithDate(key: string, value: Date): void;
type EventListenerCallback = (event: PurchaselyEvent) => void;
type PurchaseListenerCallback = () => void;
type UserAttributeSetListenerCallback = (userAttribute: PurchaselyUserAttribute) => void;
type UserAttributeRemovedListenerCallback = (userAttribute: PurchaselyUserAttribute) => void;
type DefaultPresentationResultCallback = (result: PresentPresentationResult) => void;
type PaywallActionInterceptorCallback = (result: PaywallActionInterceptorResult) => void;
declare const Purchasely: {
start: ({ apiKey, androidStores, storeKit1, userId, logLevel, runningMode, }: StartParameters) => Promise<boolean>;
addEventListener: (callback: EventListenerCallback) => import("react-native").EmitterSubscription;
removeEventListener: () => void;
addPurchasedListener: (callback: PurchaseListenerCallback) => import("react-native").EmitterSubscription;
removePurchasedListener: () => void;
addUserAttributeSetListener: (callback: UserAttributeSetListenerCallback) => import("react-native").EmitterSubscription;
removeUserAttributeSetListener: () => void;
addUserAttributeRemovedListener: (callback: UserAttributeRemovedListenerCallback) => import("react-native").EmitterSubscription;
removeUserAttributeRemovedListener: () => void;
setDefaultPresentationResultCallback: (callback: DefaultPresentationResultCallback) => void;
setPaywallActionInterceptorCallback: (callback: PaywallActionInterceptorCallback) => void;
fetchPresentation: ({ placementId, presentationId, contentId, }: FetchPresentationParameters) => Promise<PurchaselyPresentation>;
presentPresentation: ({ presentation, isFullscreen, loadingBackgroundColor, }: PresentPresentationParameters) => Promise<PresentPresentationResult>;
presentPresentationWithIdentifier: ({ presentationVendorId, contentId, isFullscreen, loadingBackgroundColor, }: PresentPresentationWithIdentifierParameters) => Promise<PresentPresentationResult>;
presentPresentationForPlacement: ({ placementVendorId, contentId, isFullscreen, loadingBackgroundColor, }: PresentPresentationPlacementParameters) => Promise<PresentPresentationResult>;
presentProductWithIdentifier: ({ productVendorId, presentationVendorId, contentId, isFullscreen, loadingBackgroundColor, }: PresentProductParameters) => Promise<PresentPresentationResult>;
presentPlanWithIdentifier: ({ planVendorId, presentationVendorId, contentId, isFullscreen, loadingBackgroundColor, }: PresentPlanParameters) => Promise<PresentPresentationResult>;
purchaseWithPlanVendorId: ({ planVendorId, offerId, contentId, }: PurchasePlanParameters) => Promise<PurchaselyPlan>;
setUserAttributeWithDate: typeof setUserAttributeWithDate;
showPresentation: () => any;
closePresentation: () => any;
hidePresentation: () => any;
signPromotionalOffer: ({ storeProductId, storeOfferId, }: SignPromotionalOfferParameters) => Promise<PurchaselyPromotionalOfferSignature>;
incrementUserAttribute: ({ key, value, }: UserAttributesParameters) => void;
decrementUserAttribute: ({ key, value, }: UserAttributesParameters) => void;
getConstants: () => Constants;
close: () => void;
getAnonymousUserId: () => Promise<string>;
userLogin: (userId: string) => Promise<boolean>;
userLogout: () => void;
setLogLevel: (logLevel: LogLevels) => void;
readyToOpenDeeplink: (ready: boolean) => void;
setAttribute: (attribute: Attributes, value: string) => void;
allProducts: () => Promise<PurchaselyProduct[]>;
productWithIdentifier: (vendorId: string) => Promise<PurchaselyProduct>;
planWithIdentifier: (vendorId: string) => Promise<PurchaselyPlan>;
restoreAllProducts: () => Promise<boolean>;
silentRestoreAllProducts: () => Promise<boolean>;
userSubscriptions: ({ invalidateCache }?: {
invalidateCache?: boolean | null;
}) => Promise<PurchaselySubscription[]>;
userSubscriptionsHistory: () => Promise<PurchaselySubscription[]>;
presentSubscriptions: () => void;
isDeeplinkHandled: (deeplink: string | null) => Promise<boolean>;
synchronize: () => void;
setLanguage: (language: string) => void;
userDidConsumeSubscriptionContent: () => void;
setUserAttributeWithString: (key: string, value: string) => void;
setUserAttributeWithNumber: (key: string, value: number) => void;
setUserAttributeWithBoolean: (key: string, value: boolean) => void;
setUserAttributeWithStringArray: (key: string, value: string[]) => void;
setUserAttributeWithNumberArray: (key: string, value: number[]) => void;
setUserAttributeWithBooleanArray: (key: string, value: boolean[]) => void;
userAttributes: () => Promise<PurchaselyUserAttribute>;
userAttribute: (key: string) => Promise<any>;
clearUserAttribute: (key: string) => void;
clearUserAttributes: () => void;
setDefaultPresentationResultHandler: () => Promise<PresentPresentationResult>;
setPaywallActionInterceptor: () => Promise<PaywallActionInterceptorResult>;
onProcessAction: (processAction: boolean) => void;
clientPresentationDisplayed: (presentation: PurchaselyPresentation) => void;
clientPresentationClosed: (presentation: PurchaselyPresentation) => void;
isAnonymous: () => Promise<boolean>;
isEligibleForIntroOffer: (planVendorId: String) => Promise<boolean>;
setThemeMode: (theme: PLYThemeMode) => void;
clearBuiltInAttributes: () => void;
setDynamicOffering: (offering: DynamicOffering) => Promise<boolean>;
getDynamicOfferings: () => Promise<DynamicOffering[]>;
removeDynamicOffering: (reference: string) => void;
clearDynamicOfferings: () => void;
};
export * from './types';
export * from './enums';
export * from './interfaces';
export { PLYPresentationView };
export default Purchasely;
//# sourceMappingURL=index.d.ts.map