Is it allowed to let the alternate app icon to be dynamic?

こ雲淡風輕ζ 提交于 2019-12-20 02:52:12

问题


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:

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:


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



来源:https://stackoverflow.com/questions/46139729/is-it-allowed-to-let-the-alternate-app-icon-to-be-dynamic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!