withStallion | HOC method for Stallion wrapped app | withStallion(App) |
useStallionModal | React hook to control Stallion modal | const { showModal } = useStallionModal();, then call showModal from anywhere |
useStallionUpdate | React hook to get status of a production release | const { isRestartRequired, currentlyRunningBundle, newReleaseBundle } = useStallionUpdate();. isRestartRequired is a boolean which tells if a new release is available and app needs to be restarted to install the release. currentlyRunningBundle, newReleaseBundle are objects containing meta information about a Stallion Release like isMandatory, release notes, version etc. |
addEventListener | Function to listen to SDK events related to a Stallion release | Stallion.addEventListener(callback). Callback will return an event object with a type and payload. Events can be DOWNLOAD_STARTED, DOWNLOAD_COMPLETE, INSTALLED_PROD, AUTO_ROLLBACK etc |
sync | Function to manually trigger Stallion workflow to check for a new available release and download it in memory | import { sync } from "react-native-stallion";. Trigger this method sync from anywhere in your app lifecycle to manually trigger a check workflow. Useful if you want to have a custom download strategy. By default Stallion.sync() is automatically fired everytime app is restarted or resumed. |
restart | Function to manually trigger an app restart for React Native apps | import { restart } from "react-native-stallion";. Call restart method from inside your custom popups / user interfaces to trigger an app relaunch. |