Let your users dynamically change their app icons directly from within the app.
$ npm install react-native-set-app-icon --save
$ react-native link react-native-set-app-icon
Setup XCode
Put all your images as @2x.png
@3x.png
in the root of your project setup.
Once that's done, go to Info.plist
and follow this setup :
import SetAppIcon from "react-native-set-app-icon";
Promise that returns a boolean. Takes the iconName
name set in your config.
SetAppIcon.changeIcon(iconName: string): Promise<boolean>;
If you want to set the default back just use null
.
SetAppIcon.changeIcon(null);
Takes a callback and receives an object with iconName
in it.
SetAppIcon.getIconName(cb: (icon: { iconName: string }) => void): void;
Returns a Promise with a boolean if the device accepts the dynamic app icon change.
SetAppIcon.supportsDynamicAppIcon(): Promise<boolean>;