API reference
Import the helpers you need:
import {
getActiveIcon,
setIcon,
getAllAlternativeIcons,
resetIcon,
} from 'react-native-alternate-app-icon';
Access the underlying Nitro hybrid object directly:
import { AlternateAppIcon } from 'react-native-alternate-app-icon';
All methods return Promises.
setIcon(iconName: string): Promise<string>
Sets the app icon to the given name. Pass "Default" to restore the primary icon.
await setIcon('AlternativeIcon');
// iOS: "Icon changed to AlternativeIcon"
// Android: "Your icon will change to AlternativeIcon" (applied on background)
await setIcon('Default');
| Parameter | Type | Description |
|---|---|---|
iconName | string | Alternate icon key from native config, or "Default" |
getActiveIcon(): Promise<string>
Returns the currently active icon name. Returns "Default" when the primary icon is active.
const activeIcon = await getActiveIcon();
console.log('Current active icon:', activeIcon);
getAllAlternativeIcons(): Promise<string[]>
Returns all icon names configured in your project.
const icons = await getAllAlternativeIcons();
console.log('Available icons:', icons);
// => ["Default", "AlternativeIcon"]
resetIcon(): Promise<string>
Resets the app icon to the primary/default icon. Equivalent to setIcon('Default').
const message = await resetIcon();
console.log(message);
// => "Icon reset to default."
Full example
See the complete example or the example app in the repository.