Changing alternate icon for iPad

后端 未结 6 881
粉色の甜心
粉色の甜心 2021-02-07 02:24

I have a problem with changing app\'s icon on iPad. Everything is working fine on iPhone but on iPad I get this error :

[default] Failed to set preferred

6条回答
  •  清酒与你
    2021-02-07 03:03

    With below structure i'm able to change icon in iPad:

        if #available(iOS 10.3, *) {
            let newAppIconName = "Icon2"
    
            guard UIApplication.shared.alternateIconName != newAppIconName else { return }
    
            UIApplication.shared.setAlternateIconName(newAppIconName)
        }
    }
    

    Plist Code:

    CFBundleIcons
    
        CFBundlePrimaryIcon
        
            CFBundleIconFiles
            
                AppIcon
            
            UIPrerenderedIcon
            
        
        CFBundleAlternateIcons
        
            Icon2
            
                CFBundleIconFiles
                
                    icon60
                
                CFBundleIcons~ipad
                
                    iTunesArtwork80.png
                
                UIPrerenderedIcon
                
            
        
    
    

提交回复
热议问题