Skip to content

Latest commit

 

History

History
78 lines (66 loc) · 2.28 KB

use-application-ios-id-for-vendor.md

File metadata and controls

78 lines (66 loc) · 2.28 KB

useApplicationIosIdForVendor

Get the app's vendor ID with Application

releases builds demo

Other hooks   —   Usage   —   Changelog


expo install @use-expo/application expo-application

Usage

// full hook
const [vendorId, getVendorId] = useApplicationIosIdForVendor();

// other options
useApplicationIosIdForVendor({ get: false });

Example

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>
    );
}

API

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