Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
LSApplicationProxy - iPhone Development Wiki

LSApplicationProxy

From iPhone Development Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

LSApplicationProxy is an object that provides information about App Store applications via a proxy.

Using LSApplicationProxy in your project

Add MobileCoreServices to your Makefile

Tweak_PRIVATE_FRAMEWORKS = MobileCoreServices

Header:

@interface LSApplicationProxy : NSObject
+ (id)applicationProxyForIdentifier:(id)arg1;
- (NSString *)localizedNameForContext:(id)arg1; // iOS 11+
- (NSString *)localizedName; // iOS 5-10
- (NSURL *)bundleURL;
- (NSURL *)containerURL;
- (NSString *)bundleExecutable;
- (NSString *)bundleIdentifier;
- (NSString *)vendorName;
- (NSString *)teamID;
- (NSString *)applicationType;
- (NSSet *)claimedURLSchemes;
- (BOOL)isDeletable;
@end

Creating an application proxy

LSApplicationProxy *proxy = [LSApplicationProxy applicationProxyForIdentifier:bundleIdentifier];
NSString *genre = [proxy genre];

Getting display name for an application proxy

// iOS 11+
NSString *name = [proxy localizedNameForContext:nil];

// iOS 5-10
NSString *name = [proxy localizedName];