0

I want to launch an ios app by using its app identifier in ios 6. I know the URL scheme but I don't to be dependent on URL scheme key. My device is non-jailbreak. Please keep it in mind my app is in-house app it will not be published on app store I have found this method on stack overflow :

void* sbServices = dlopen("/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices", RTLD_LAZY);
int (*SBSLaunchApplicationWithIdentifier)(CFStringRef identifier, Boolean suspended) = dlsym(sbServices, "SBSLaunchApplicationWithIdentifier");
const char *strBundleId = [bundleId cStringUsingEncoding:NSUTF8StringEncoding]; int result = SBSLaunchApplicationWithIdentifier((__bridge CFStringRef)bundleId, NO);
dlclose(sbServices);

It returns 1 means true but doesn't launch or open an app.

Dharmesh Dhorajiya
  • 3,976
  • 9
  • 30
  • 39
iOS_Learner
  • 159
  • 9
  • "It returns 1 means true" – it looks like it returns an error code, then. Also note that you will need certain entitlements in order to be able to use this function (I don't remember exactly which ones, just google it.) – The Paramagnetic Croissant Oct 07 '15 at 05:57
  • @Dharmesh Dhorajiya I have tried with entitlements com.apple.springboard.launchapplications. but failed to compile with added entitlemet. Got code signing error. – iOS_Learner Oct 07 '15 at 06:00
  • @TheParamagneticCroissant have tried with entitlements com.apple.springboard.launchapplications. but failed to compile with added entitlemet. Got code signing error. – iOS_Learner Oct 07 '15 at 06:28

0 Answers0