给定包 ID 的包图标

Nic*_*ick 1 iphone cocoa-touch bundle objective-c

有没有办法(如果有,如何)获取给定应用程序包 ID 的图标。假设我有一个UIImage我想包含与 facebook 应用程序关联的图标(如果我的 iOS 设备上安装了这样的图标)。

小智 5

您可以使用私有 API。这可能对内部应用有用。

@interface UIImage (UIApplicationIconPrivate)
/*
 @param format
    0 - 29x29
    1 - 40x40
    2 - 62x62
    3 - 42x42
    4 - 37x48
    5 - 37x48
    6 - 82x82
    7 - 62x62
    8 - 20x20
    9 - 37x48
    10 - 37x48
    11 - 122x122
    12 - 58x58
 */
+ (UIImage *)_applicationIconImageForBundleIdentifier:(NSString *)bundleIdentifier format:(int)format;
@end
Run Code Online (Sandbox Code Playgroud)