Skip to content

Latest commit

 

History

History
84 lines (71 loc) · 2.4 KB

use-store-review-is-available.md

File metadata and controls

84 lines (71 loc) · 2.4 KB

useStoreReviewIsAvailable

Determines if the platform has the capabilities to use request review with StoreReview

releases builds demo

Other hooks   —   Usage   —   Changelog


expo install @use-expo/store-review expo-store-review

Usage

// full hook
const [isAvailable, getIsAvailable] = useStoreReviewIsAvailable();

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

Example

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

API

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