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: Difference between revisions - iPhone Development Wiki

LSApplicationProxy: Difference between revisions

From iPhone Development Wiki
(Created page with "'''LSApplicationProxy''' is an object that provides information about App Store applications via a proxy. === Note: Does not work for system apps === == Using LSApplicationP...")
 
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''LSApplicationProxy''' is an object that provides information about App Store applications via a proxy.
'''LSApplicationProxy''' is an object that provides information about App Store applications via a proxy.
=== Note: Does not work for system apps ===


== Using LSApplicationProxy in your project ==
== Using LSApplicationProxy in your project ==


Add SpringBoardServices to your Makefile
Add MobileCoreServices to your Makefile


<source>
<source>
Tweak_PRIVATE_FRAMEWORKS = SpringBoardServices
Tweak_PRIVATE_FRAMEWORKS = MobileCoreServices
</source>
 
Header:
<source lang=objc>
@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
</source>
</source>


Line 17: Line 33:
NSString *genre = [proxy genre];
NSString *genre = [proxy genre];
</source>
</source>
== Getting display name for an application proxy ==
<source lang=objc>
// iOS 11+
NSString *name = [proxy localizedNameForContext:nil];
// iOS 5-10
NSString *name = [proxy localizedName];
</source>
{{occlass|library=CoreServices.framework|navbox=on}}

Latest revision as of 07:40, 4 September 2023

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];