The codePush wrapper
The default export wraps your root component. With no options, the app checks for an update on every start and installs it on the next restart.
import CodePush from "@aetherpush/react-native-code-push";
function App() { return null;}
export default CodePush(App);Pass options to change the behavior:
export default CodePush({ checkFrequency: CodePush.CheckFrequency.ON_APP_RESUME, installMode: CodePush.InstallMode.ON_NEXT_RESUME,})(App);Options
Section titled “Options”| Option | Default | Purpose |
|---|---|---|
checkFrequency |
ON_APP_START |
When the wrapper checks for updates: on start, on resume, or MANUAL to leave it to your own sync() calls. |
installMode |
ON_NEXT_RESTART |
When a downloaded optional update activates. |
mandatoryInstallMode |
IMMEDIATE |
When a mandatory update activates. |
minimumBackgroundDuration |
0 |
For the resume install modes: how many seconds the app must stay in the background before an update installs on resume. |
deploymentKey |
native config | Check a different deployment than the one in the binary. |
serverPathMode |
"aether" |
URL path style; see SDK configuration. |
updateDialog |
off | Ask the user before installing. Pass true for the default texts or an object to change them. |
rollbackRetryOptions |
off | Let the app retry an update that was rolled back on this device. |
The update dialog
Section titled “The update dialog”updateDialog: true shows a dialog titled “Update available” with Install and Ignore buttons for optional updates, and a Continue button for mandatory ones. Every text is configurable (title, optionalUpdateMessage, optionalInstallButtonLabel, optionalIgnoreButtonLabel, mandatoryUpdateMessage, mandatoryContinueButtonLabel), and appendReleaseDescription: true adds the release description to the message, prefixed by descriptionPrefix (default " Description: ").
Rollback retry
Section titled “Rollback retry”When an update crashes before confirming itself, the device rolls back and normally never tries that release again. rollbackRetryOptions allows retries: delayInHours (default 24) sets the wait between attempts, and maxRetryAttempts (default 1, minimum 1) caps them.