Skip to content

Instantly share code, notes, and snippets.

@olxios
Last active May 29, 2016 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olxios/a18b63c0c408c63d04d1ce19dadca20e to your computer and use it in GitHub Desktop.
Save olxios/a18b63c0c408c63d04d1ce19dadca20e to your computer and use it in GitHub Desktop.
// We need only one method, no need to import all the framework headers
@interface PrivateApi_LSApplicationWorkspace
- (bool)openApplicationWithBundleID:(id)arg1;
@end
@implementation AppBackgroundUtil
+ (void)bringOtherAppToFront
{
PrivateApi_LSApplicationWorkspace* _workspace;
_workspace = [NSClassFromString(@"LSApplicationWorkspace") new];
// If the application is running in background, this will bring it to front.
// If the application is not running, it will launch it.
[_workspace openApplicationWithBundleID:@"com.yourcompany.example"];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment