Skip to content

Commit

Permalink
Merge pull request #484 from wyne/review-prompt
Browse files Browse the repository at this point in the history
Review prompt 30d, align analytics
  • Loading branch information
wyne authored Aug 4, 2024
2 parents 570177d + 3e24775 commit 77ec4d5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/components/Buttons/HomeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@ const HomeButton: React.FunctionComponent<Props> = ({ navigation }) => {
const daysSinceLastPrompt = (now - lastStoreReviewPrompt) / (1000 * 60 * 60 * 24);

if (gameCount < 3) { return; }
if (daysSinceLastPrompt < 90) { return; }
if (daysSinceLastPrompt < 30) { return; }

await logEvent('review_prompt', {
daysSinceLastPrompt,
gameCount,
installId
});

dispatch(setLastStoreReviewPrompt(Date.now()));

const isAvailable = await StoreReview.isAvailableAsync();

if (isAvailable) {
await logEvent('review_prompt', {
daysSinceLastPrompt,
gameCount,
installId
});

dispatch(setLastStoreReviewPrompt(Date.now()));

const platform = Platform.OS;
if (platform === 'ios') {
StoreReview.requestReview();
Expand Down

0 comments on commit 77ec4d5

Please sign in to comment.