Installation
Requirements
- React Native
>=0.76 - React Native New Architecture enabled
- Android API
>=24 - An iOS deployment target supported by the installed React Native version
The package has no legacy architecture layer and does not depend on expo-modules-core.
Bare React Native
Install with npm:
npm install @boiboif/react-native-toastOr Yarn:
yarn add @boiboif/react-native-toastInstall CocoaPods dependencies on iOS:
npx pod-installReact Native autolinking registers the Android package and iOS Pod. You do not need to modify MainApplication or AppDelegate.
Confirm the New Architecture
Android should contain this setting in android/gradle.properties:
newArchEnabled=trueNew React Native 0.76 and later templates enable the New Architecture by default. Projects upgraded from older releases should follow the upgrade guide for their exact React Native version and reinstall Pods.
Android repository setup
Android depends on com.github.getActivity:Toaster:13.8, hosted on JitPack. The library declares JitPack itself. Apps that enforce repositories from settings.gradle must add:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}Verify the installation
import { Button, View } from 'react-native';
import Toast from '@boiboif/react-native-toast';
export default function App() {
return (
<View>
<Button title="Show toast" onPress={() => Toast.show('It works')} />
</View>
);
}Rebuild the native app after installing or upgrading the package. Reloading Metro alone cannot update the native binary.
Next steps
- Continue with usage and configuration
- Read the Expo integration guide for Expo projects
- Check troubleshooting when installation fails