Is it allowed to let the alternate app icon to be

2020-04-17 07:38发布

Since iOS 10.3 has been released, Apple added a new feature which allows us to change the app icon dynamically, by using setAlternateIconName(_:completionHandler:) method. So far, as mentioned in the method documentation, we have to mention the name(s) of the alternate app icon(s) in the project .plist file, assigned to CFBundlePrimaryIcon key.

Actually, when working with static icons (icons that have been added directly to the app main bundle) it works as expected without any problems:

enter image description here

My question is:

Is it possible -or is there a workaround- to set the alternate app icon dynamically (for instance: icons that have been downloaded from the web and saved in the app documents directory)?

1条回答
Animai°情兽
2楼-- · 2020-04-17 08:13

I don't think its possible.

setAlternateIconName(_:completionHandler:) API looks for the icons inside app bundle and cannot be changed to fetch from sandbox.

Also, most probably Apple reviews the app icons you have bundled for avoiding use of same app icons or icons similar to Apple apps.

Refer: https://www.hackingwithswift.com/example-code/uikit/how-to-change-your-app-icon-dynamically-with-setalternateiconname

查看更多
登录 后发表回答