No edit summary |
|||
Line 30: | Line 30: | ||
Note 2. this method will only work if on the home screen. It will not work when already in an application. | Note 2. this method will only work if on the home screen. It will not work when already in an application. | ||
== Application Info.plist == | == Application Info.plist == | ||
SpringBoard will recognize the following Info.plist keys: | SpringBoard will recognize the following Info.plist keys: | ||
* UISystemProvisioning | * UISystemProvisioning | ||
* SBDemoRole<ref name="hunt">http://blogs.oreilly.com/iphone/2008/11/hunting-down-infoplist-prefere.html</ref> | * SBDemoRole<ref name="hunt">http://blogs.oreilly.com/iphone/2008/11/hunting-down-infoplist-prefere.html</ref> | ||
Line 47: | Line 49: | ||
Starting from 3.2 these ''documented'' keys are also recognized: | Starting from 3.2 these ''documented'' keys are also recognized: | ||
* ProductType, UIDeviceFamily, DeviceFamily<ref>The keys UIDeviceFamily and DeviceFamily are private but equivalent to ProductType.</ref> | * ProductType, UIDeviceFamily, DeviceFamily<ref>The keys UIDeviceFamily and DeviceFamily are private but equivalent to ProductType.</ref> | ||
* UIAppFonts | * UIAppFonts | ||
Line 54: | Line 56: | ||
As of iOS 8, the following undocumented key is also recognized: | As of iOS 8, the following undocumented key is also recognized: | ||
* _UILaunchAlwaysFullScreen<ref>http://pastebin.com/XmRqevnD</ref> | * _UILaunchAlwaysFullScreen<ref>http://pastebin.com/XmRqevnD</ref> | ||
Revision as of 21:11, 3 January 2015
SBApplication is a class representing the application screen on the SpringBoard. SBApplication is a subclass of SBDisplay. See SBDisplay for more info.
Retrieving an instance of SBApplication
To retrieve a known instance, you must go through SBApplicationController. For example, if the display ID of the application is known, you can use:
SBApplication* app = [[SBApplicationController sharedInstance] applicationWithDisplayIdentifier:@"com.yourcompany.appname"];
Get all active applications
Signature | -(NSArray*)_accessibilityRunningApplications; |
---|---|
Available in | 3.0 – |
Signature | -(SBApplication*)_accessibilityFrontMostApplication; |
---|---|
Available in | 3.2 – |
Getting active applications traditionally need to be done via the static function at 0xeadc, or evaluate through the result of -[SBApplicationController allApplications] and check if the pid is valid. Fortunately, starting from 3.0, the SpringBoard class provides a method -[SpringBoard _accessibilityRunningApplications] which directly calls 0xeadc. Therefore, you can get the array of active applications from this.
Starting from 3.2 one can also use -[SpringBoard _accessibilityFrontMostApplication] to get the front most application. If you know the app you can check if [[app process] isFrontmost].
Launching an SBApplication
To launch an SBApplication you can use SBUIController:
[[SBUIController sharedInstance] activateApplicationAnimated:app];
Note 1. this method will not respect parental control. You can look up the list of restricted apps using -[SpringBoard parentalControlsDisabledApplications], however.
Note 2. this method will only work if on the home screen. It will not work when already in an application.
Application Info.plist
SpringBoard will recognize the following Info.plist keys:
- UISystemProvisioning
- SBDemoRole[1]
- SBIsRevealable[1][2]
- SBUsesNetwork[3]
- UIJetsamPriority
- SBIconClass
- SBSpotlightIcons
- UIRoles
- SBMachServices
- disabled
- CFBundleIconFile
- SPSearchDomainLaunchInfo
- SBAppTags[4][5]
- Other UIKit keys described in http://developer.apple.com/IPhone/library/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html
Starting from 3.2 these documented keys are also recognized:
- ProductType, UIDeviceFamily, DeviceFamily[6]
- UIAppFonts
- UIFileSharingEnabled
- UISupportedInterfaceOrientations
As of iOS 8, the following undocumented key is also recognized:
- _UILaunchAlwaysFullScreen[7]
Now Playing App Info
Getting the App info of the nowPlayingApp is now possible, thanks to SBMediaController's property (int _nowPlayingProcessPID) To do so, you must use SBMediaPlayer in combination with SBApplication itself:
int pid = [SBMediaPlayer sharedInstance].nowPlayingProcessPID
SBApplication *nowPlayingApp = [SBApplicationController applicationWithPid:pid];
Now, you can use many of SBApplication's useful methods (like -(id)displayName and -(id)bundleIdentifier) to retrieve app Info of the nowPlaying app.
References
- ↑ 1.0 1.1 http://blogs.oreilly.com/iphone/2008/11/hunting-down-infoplist-prefere.html
- ↑ http://www.tuaw.com/2007/11/29/enable-app-hiding-on-your-iphone/
- ↑ http://stackoverflow.com/questions/596589/iphone-sdk-internet-connection-detection
- ↑ http://www.ifans.com/forums/threads/what-keeps-these-hidden.331215/#post-2552445
- ↑ http://www.ifans.com/forums/threads/hide-applications.76176/#post-717439
- ↑ The keys UIDeviceFamily and DeviceFamily are private but equivalent to ProductType.
- ↑ http://pastebin.com/XmRqevnD