Bring the app to the forefront

Is there a way to bring my application to the forefront as soon as the timer ends? This is for a kiosk-like application that will display some information at different points during a user session.

This application will be installed only on our corporate devices, therefore it will not be submitted for approval by Apple. I also make it possible to search for jailbreak options.

I would appreciate any help / advice that you guys can provide. Thank you

+2
source share
2 answers

Yes, you can technically use Xcode to develop a jailbreak (but you don't have to). If you want your application to be installed outside the usual sandbox, and in / Applications / , then you would build using Xcode without signing a code, a fake code sign (or using a self-signed certificate), and then copy / install the application on your device using scp or something similar (maybe there is a script for this).

You can search on Google with tools like Theos, Logos, or iOSOPenDev. More here

Also see this page for information on faking code using Xcode .

In terms of bringing the application to the forefront, there are at least a few ways to handle this:

One could use Cydia to install the (free) open utility. With open you can invoke a command line call to open any application using its package identifier (for example, open com.mycompany.MyAppName ). If you want to do this programmatically, run this command in the system() call:

  #import <stdlib.h> int returnCode = system("/usr/bin/open com.mycompany.MyAppName"); 

Another option is to see this answer from @WrightsCS . Be sure to also read comments on where this happens.


Update: in terms of placing your application in the background, you can completely kill the application using exit(0) or [[UIApplication sharedApplication] terminateWithSuccess] . Or, see this answer to solve a software simulation of the home button, click , which will send the application to the background without killing it.

You will not be able to use NSTimer because timers do not work when your application is in the background. However, you can use the GCD blocks to start the background and make a call to system() with open to bring you to the forefront.

Look at this answer, probably scroll all the way to the end of your post

or look at this similar answer, which was actually posted at the bottom of the question

+3
source

Jailbroken options to bring your application to the forefront:

Connect to SpringBoard using MobileSubstrate. You can find classes and methods with promising names such as [SBApplicationIcon launch] and [SBApplication launch] . Another possibility is to use SBSLaunchApplicationWithIdentifier() from the private SpringBoardServices structure.

Application pause options:

Most likely, you can do it again using MobileSubstrate so that SpringBoard closes a specific application for you. Perhaps you can simulate a button press at home by calling [SBUIController handleMenuTap] or something like that.

+1
source

All Articles