Skip to content

Commit

Permalink
chore: [IOPLT-780] Adds react-native-store-review library to reques…
Browse files Browse the repository at this point in the history
…t on demand review (#6486)

## Short description
This PR implements and integrate an in-app review library to ask for a
store review.

## List of changes proposed in this pull request
- Adds `react-native-store-review`
- Adds the test button into the app developer section

## How to test
Launch the app and check the test button under developer section


https://github.com/user-attachments/assets/2c90ec34-96c1-4afa-a144-f315ace13c22

Co-authored-by: Alessandro <[email protected]>
  • Loading branch information
CrisTofani and Hantex9 authored Dec 3, 2024
1 parent 446cabc commit 6b11464
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ PODS:
- Sentry/HybridSDK (= 8.36.0)
- RNShare (10.2.1):
- React-Core
- RNStoreReview (0.4.3):
- React-Core
- RNSVG (15.1.0):
- React-Core
- Sentry/HybridSDK (8.36.0)
Expand Down Expand Up @@ -793,6 +795,7 @@ DEPENDENCIES:
- RNScreens (from `../node_modules/react-native-screens`)
- "RNSentry (from `../node_modules/@sentry/react-native`)"
- RNShare (from `../node_modules/react-native-share`)
- RNStoreReview (from `../node_modules/react-native-store-review`)
- RNSVG (from `../node_modules/react-native-svg`)
- VisionCamera (from `../node_modules/react-native-vision-camera`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
Expand Down Expand Up @@ -1013,6 +1016,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/@sentry/react-native"
RNShare:
:path: "../node_modules/react-native-share"
RNStoreReview:
:path: "../node_modules/react-native-store-review"
RNSVG:
:path: "../node_modules/react-native-svg"
VisionCamera:
Expand Down Expand Up @@ -1127,6 +1132,7 @@ SPEC CHECKSUMS:
RNScreens: b8d370282cdeae9df85dd5eab20c88eb5181243b
RNSentry: 3e667c2c6ea5d35ea292c7f262c6b44e43842cc1
RNShare: 0fad69ae2d71de9d1f7b9a43acf876886a6cb99c
RNStoreReview: 31dbfd0dac2eea9675f0b84f1dd3261c2110c337
RNSVG: 50cf2c7018e57cf5d3522d98d0a3a4dd6bf9d093
Sentry: f8374b5415bc38dfb5645941b3ae31230fbeae57
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Expand Down
1 change: 1 addition & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ profile:
clearAsyncStorage: Clear AsyncStorage
dumpAsyncStorage: Dump AsyncStorage content to console
sentryTestEvent: Send Exception to Sentry
storeReview: Request a store review
contextualHelpTitle: What you can do in {{pageName}} section
legacyContextualHelpContent: !include profile/legacy_profile_account_main.md
contextualHelpContent: !include profile/profile_account_main.md
Expand Down
1 change: 1 addition & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ profile:
clearAsyncStorage: Cancella contenuto di AsyncStorage
dumpAsyncStorage: Scarica contenuto di AsyncStorage
sentryTestEvent: Invia Exception a Sentry
storeReview: Richiedi una recensione sullo store
contextualHelpTitle: Cosa puoi fare nella sezione {{pageName}}
legacyContextualHelpContent: !include profile/legacy_profile_account_main.md
contextualHelpContent: !include profile/profile_account_main.md
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"react-native-screens": "^3.31.1",
"react-native-share": "^10.2.1",
"react-native-splash-screen": "^3.2.0",
"react-native-store-review": "^0.4.3",
"react-native-svg": "^15.1.0",
"react-native-tab-view": "3.5.2",
"react-native-url-polyfill": "^2.0.0",
Expand Down
7 changes: 7 additions & 0 deletions ts/screens/profile/DeveloperModeSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { isDevEnv } from "../../utils/environment";
import { ITW_ROUTES } from "../../features/itwallet/navigation/routes";
import { isCieIDLocalFeatureEnabledSelector } from "../../features/cieLogin/store/selectors";
import { cieIDFeatureSetEnabled } from "../../features/cieLogin/store/actions";
import { requestAppReview } from "../../utils/storeReview";
import DSEnableSwitch from "./components/DSEnableSwitch";

type PlaygroundsNavListItem = {
Expand Down Expand Up @@ -158,6 +159,12 @@ const DeveloperActionsSection = () => {
color: "primary",
label: I18n.t("profile.main.sentryTestEvent"),
onPress: sendSentryTestEvent
},
{
condition: true,
color: "primary",
label: I18n.t("profile.main.storeReview"),
onPress: requestAppReview
}
];

Expand Down
3 changes: 3 additions & 0 deletions ts/utils/storeReview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import * as StoreReview from "react-native-store-review";

export const requestAppReview = () => StoreReview.requestReview();
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13809,6 +13809,11 @@ react-native-splash-screen@^3.2.0:
resolved "https://registry.yarnpkg.com/react-native-splash-screen/-/react-native-splash-screen-3.2.0.tgz#d47ec8557b1ba988ee3ea98d01463081b60fff45"
integrity sha512-Ls9qiNZzW/OLFoI25wfjjAcrf2DZ975hn2vr6U9gyuxi2nooVbzQeFoQS5vQcbCt9QX5NY8ASEEAtlLdIa6KVg==

react-native-store-review@^0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/react-native-store-review/-/react-native-store-review-0.4.3.tgz#a524374b1a897b1de1b05d6257640296f1693e3c"
integrity sha512-RSQ6vx2j4p41GwTqNv2VV7yold62j5qDbGEBAjFi6gkXMrMpxFMg+82FPjbh6012tqv6Ebzwfqw6S4m4d7sddw==

react-native-svg-transformer@^0.14.3:
version "0.14.3"
resolved "https://registry.yarnpkg.com/react-native-svg-transformer/-/react-native-svg-transformer-0.14.3.tgz#43c8e176f5a11f16f39b87a64018e0ac090ffbdb"
Expand Down

0 comments on commit 6b11464

Please sign in to comment.