I need to change the app icon based on region, is this possible?
Tap the placeholder app icon. From the drop-down menu, select Take Photo, Choose Photo, or Choose File, depending on where your replacement app icon image is located. Select your replacement image. In the text field, rename the app as you want it to appear on the home screen.
The easiest way to decorate your android. Icon Changer is the application that makes shortcut with a new icon at home screen. Icon can be chosen from gallery and lots of icon packs.
Yes, this is possible since iOS 10.3.
First, you need to define all alternative icons in your Info.plist file, you can't fetch them dynamically.
In the example below we define 2 alternative icons: "de" and "fr":
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>de</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_de</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
<key>fr</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_fr</string>
</array>
<key>UIPrerenderedIcon</key>
<false/>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>ic_none</string>
</array>
</dict>
</dict>
Then you can set the icon name based on anything you like (game progress, weather conditions, premium user, etc.). To change the icon use:
UIApplication.shared.setAlternateIconName("de") { (error) in
if let error = error {
print("err: \(error)")
// icon probably wasn't defined in plist file, handle the error
}
}
Result:
The gif is from a Medium article by Julien Quéré.
This feature available in 10.3 (Beta)
Discussion Use this method to change your app's icon to its primary icon or to one of its alternate icons. You can change the icon only if the value of the supportsAlternateIcons property is true.
You must declare your app's primary and alternate icons using the CFBundleIcons key of your app's Info.plist file. For information about how to configure alternate icons for your app, see the description of the CFBundleIcons key in Information Property List Key Reference.
Take a look at:
apple documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With