I saw some old post about localize an app icon on IOS, I want to know if there are a way to do it now or if it still impossible? I didn't find anything about it
First you need to check the current country and to do so you need to install react-native-localize
$ npm install --save react-native-localize
# --- or ---
$ yarn add react-native-localize
and the usage to get the country:
import * as RNLocalize from "react-native-localize";
const country = RNLocalize.getCountry();
Now we need to change the icon programmatically using react-native-dynamic-app-icon Since iOS 10.3 Apple supports alternate App Icons to be set programmatically. This package integrates this functionality as React Native module. Android is not yet supported .
To Install:
$ npm install react-native-dynamic-app-icon
Mostly automatic installation
$ react-native link react-native-dynamic-app-icon
Usage:
import AppIcon from 'react-native-dynamic-app-icon';
//check the language then:
AppIcon.setAppIcon('alternate');
//to get the icon name:
AppIcon.getIconName(result => {
alert( 'Icon name: ' + result.iconName );
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.