Get the app's vendor ID with Application
Other hooks — Usage — Changelog
expo install @use-expo/application expo-application
// full hook
const [vendorId, getVendorId] = useApplicationIosIdForVendor();
// other options
useApplicationIosIdForVendor({ get: false });
import { useApplicationIosIdForVendor } from '@use-expo/application';
import React from 'react';
import { Text, View } from 'react-native';
function ApplicationIosIdForVendorExample() {
const [vendorId] = useApplicationIosIdForVendor();
return (
<View>
<Text>Application vendor id: {vendorId || '-'}</Text>
</View>
);
}
function useApplicationIosIdForVendor(options?: Options): Result;
interface Options {
/** If it should fetch the application vendor id when mounted, defaults to `true` */
get?: boolean;
}
type Result = [
/** The current application vendor id */
string | undefined,
/** Callback to manually get the application vendor id */
() => Promise<void>,
];
with ❤️ byCedric