import { useCallback , useEffect , useState } from 'react' ; import { getIosIdForVendorAsync } from 'expo-application' ; see https see https example export function useApplicationIosIdForVendor ( options = { } ) { const [ applicationIdForVendor , setApplicationIdForVendor ] = useState < string > ( ) ; const { get = true } = options ; const getApplicationIdForVendor = useCallback ( ( ) => ( getIosIdForVendorAsync ( ) . then ( setApplicationIdForVendor ) ) , [ ] ) ; useEffect ( ( ) => { if ( get ) { getApplicationIdForVendor ( ) ; } } , [ get , getApplicationIdForVendor ] ) ; return [ applicationIdForVendor , getApplicationIdForVendor ] ; } export interface ApplicationIosIdForVendorOptions { /** If it should fetch the application vendor id when mounted, defaults to `true` */ get ? : boolean ; }