Skip to main content

Application registration

Use registerApplication when you supply your own entry file. The app generator calls it for you; generated App.js files only export the root component.

import React from 'react';
import {Chrome, Text, View, registerApplication} from 'react-kindle';

function App() {
return <View style={{flex: 1, padding: 24}}><Text>Reader</Text></View>;
}

registerApplication({
id: 'com.lab126.Reader',
firmware: '5.19.6',
component: App,
chrome: Chrome.none,
});

Set firmware to the device release. The ID must match the launcher's --name Reader argument.

Options​

OptionDescription
idRequired com.lab126.NAME; NAME begins with a letter and contains only letters and digits.
componentRequired React root component.
firmwareRequired dotted numeric firmware release.
chromeInitial mode; defaults to Chrome.none.
presentationOptional classic or unified styling override.
fontScaleOptional positive scale override.
onRequestCloseCalled on native shutdown requests. Your app supplies the exit integration.
onLayoutReceives root window layout events.

Registration installs KindleProvider, the native root window, style defaults, and managed lifecycle listeners. It returns a function that removes those listeners; that function does not terminate the process.

In generated apps, export onRequestClose and onWindowLayout from App.js to supply the callbacks. See application lifecycle for managed launch and shutdown.

Chrome modes​

ConstantValueUse
Chrome.automatic0Let the system select chrome.
Chrome.none1No system chrome.
Chrome.status2Status bar.
Chrome.navigation3Status and navigation bars.
Chrome.full4Full system chrome mode.

Set the numeric mode in app.json, or use the constants in JavaScript. See system chrome for title and menu configuration.