import { UserDataRequest } from '../types/IAPTypes'; /** * useIapUserData hook should be called in your main screen component. This hook automatically invokes * getUserData API and populates states during main screen launch and App state transitions from BG -> FG. * "iapUserData" state returned by this hook will help you to make sure that you retrieve the * receipts for the current user account. * * This hook handles case where the user switched account when your app went to background. State * "iapUserData" will be populated when the app comes to foreground and would trigger your logic * to retrieve receipts for the current user. * * ```ts * Sample Usage: * export const AppMainPage = () => { * // Calling useIapUserData in main screen * const {iapUserDataLoading, iapUserDataError, iapUserData} = useIapUserData({}); * ... * ... * // Once Userdata is loaded, call handler * if (!iapUserDataLoading) { * if (iapUserDataError) { * // Handle Error based on iapUserData.responseCode * ... * } else { * // Persist the iapUserData.userId and retrieve receipts for this user. * ... * } * } * ... * } * ``` * * @param getUserDataRequest User Data request parameters * @returns States and value of user data */ export declare const useIapUserData: (getUserDataRequest: UserDataRequest) => { iapUserDataLoading: any; iapUserDataError: any; iapUserData: any; };