This is an example of integrating https://github.com/react-native-google-cast/react-native-google-cast in Expo 47.
This example was created using the following steps:
-
npm i -g expo-cli
-
expo init RNGCExpo
-
cd RNGCExpo
-
yarn add react-native-google-cast
-
Add to
app.json
:{ "expo": { "plugins": ["@config-plugins/react-native-google-cast"] } }
-
Add to
App.tsx
import { CastButton, useCastState } from "react-native-google-cast"; <CastButton style={{ tintColor: "black", height: 48, width: 48 }} />;
-
yarn android
oryarn ios
* to build and run the app.* If you're using M1/ARM Macs, update the generated
ios/Podfile
and rerunpod install
as described in https://react-native-google-cast.github.io/docs/getting-started/installation.html#ios
Additionally, I built the app using EAS.
-
npm i -g eas-cli
-
eas login
-
Create
eas.json
:{ "build": { "preview": { "android": { "buildType": "apk" } } } }
-
eas build -p android --profile preview
You can download the APK from https://expo.dev/artifacts/eas/2wNCoXKb8eeMiRMuobGoRC.apk