Determines if the platform has the capabilities to use request review with StoreReview
Other hooks — Usage — Changelog
expo install @use-expo/store-review expo-store-review
// full hook
const [isAvailable, getIsAvailable] = useStoreReviewIsAvailable();
// other options
useStoreReviewIsAvailable({ get: false });
import { useStoreReviewIsAvailable } from '@use-expo/store-review';
import React, { useEffect } from 'react';
import { Text, View } from 'react-native';
function StoreReviewIsAvailableExample() {
const [isAvailable] = useStoreReviewIsAvailable();
useEffect(() => {
if (isAvailable) {
console.log('StoreReview is available');
}
}, [isAvailable]);
return (
<View>
<Text>Hello StoreReview</Text>
</View>
);
}
function useStoreReviewIsAvailable(options?: Options): Result;
interface Options {
/** If it should fetch the store review is available when mounted, defaults to `true` */
get?: boolean;
}
type Result = [
/** The current store review is available */
boolean | undefined,
/** Callback to manually get the store review is available */
() => Promise<void>,
];
with ❤️ byCedric