2

I have problem. I need solve this problem for jailbreak iOS. My application works in background mode. I want that application go to foreground mode from background after some events. I tried next instruction:

system([[NSString stringWithFormat:@"uiopen \"%@\"", @"appname://"] UTF8String])

But application didn't run from background. App run as new process. Thank you.

1 Answers1

3

User private API:

   int SBSLaunchApplicationWithIdentifier(CFStringRef displayIdentifier, Boolean suspended);

It's defined in SpringboardServices private framework.

You will need to add entitlement "com.apple.springboard.launchapplications" for this to work.

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
  • I add entitlements: com.apple.springboard.launchapplications And add instruction: BSLaunchApplicationWithIdentifier(CFSTR("app.id"), NO); But when I build my app, I have error: "Undefined symbols for architecture armv7: "_BSLaunchApplicationWithIdentifier", referenced from: _displayStatusChanged in GlobusAppDelegate.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)". How add SpringboardServices framework in my project??? Thank you!!! – kvofreelance Aug 18 '13 at 23:55
  • First of all. It it's "SBSLaunchApplicationWithIdentifier" and not "BSLaunchApplicationWithIdentifier". Look at these question regarding adding private frameworks to project: http://stackoverflow.com/questions/4201525/how-to-import-private-frameworks-in-xcode http://stackoverflow.com/questions/12322010/how-to-add-private-framework-to-target-dependencies http://stackoverflow.com/questions/7754070/how-to-add-private-frameworks-into-project – Victor Ronin Aug 19 '13 at 01:34
  • So, I successfully add private framework, but I have new problem. How I must right add entitlement? I did next: 1. Create file 123.xml with com.apple.springboard.launchapplications – kvofreelance Aug 19 '13 at 15:27
  • 2. Did next instruction ./ldid -S123.xml AppName.app/AppName But after this ldid didn't finish and require enter something(didn't write what I must enter only empty row. I must exit by pressing ctrl+z) – kvofreelance Aug 19 '13 at 15:34
  • @kvofreelance: I am not sure. I would recommend to ask this as a separate question. – Victor Ronin Aug 19 '13 at 21:21
  • So I successfully added entitlement.xml via ldid. But I have other questions: 1. I didn't checked Targets->AppName->Summary->Entitlements (is it true or false ?) 2. I create AppName.ipa which consist with: ItunesArtwork, Payload->(Globus.app, Info.plist) I installed app via iTools. MyApp is run but can't do some function. I try authorization via Internet. But when I install app without added entitlement an do some instruction with ldid, application working fine. Please help me – kvofreelance Aug 20 '13 at 23:00
  • 1
    @kvofreelance: please write a separate question (it's good stackoverflow practice to write a question for each concern). And give more details in that question on what functionality doesn't work in your case and how it fails. – Victor Ronin Aug 21 '13 at 00:07
  • Roni: I create separate question on link http://stackoverflow.com/questions/18347180/how-add-entitlement-via-ldid – kvofreelance Aug 21 '13 at 00:51