2011-03-28 54 views
1

有没有一种方法(如果是这样,如何)获取给定应用程序包ID的图标。假设我有一个UIImage,我想包含与facebook应用程序相关的图标(如果这些图标安装在我的iOS设备上)。捆绑图标给定包ID

+2

这将涉及到的代码,将有机会获得您的沙箱之外,更可能会在应用程序商店审查程序被阻止。您可能需要考虑尝试从第三方来源(如http://appshopper.com/)获取图标,并获得他们的许可。 – Joe 2011-03-28 21:41:25

回答

0

从用户的应用程序访问数据是在生产中的应用是不可能的,因为苹果公司提供了iOS应用程序编程指南中的明确和彻底的定义:

For security reasons, iOS restricts each application (including its preferences and data) to a unique location in the file system. This restriction is part of the security feature known as the application’s sandbox. The sandbox is a set of fine-grained controls limiting an application’s access to files, preferences, network resources, hardware, and so on. Each application has access to the contents of its own sandbox but cannot access other applications’ sandbox.

Link

虽然理论上是可能的在实践中,它肯定会被禁止访问iOS App Store,因为它会直接违背上述准则。

4

您可以使用私有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