user2830000
user2830000

Reputation: 31

Iphone 5 application launch by another application

I am using following code:

int (*openApp)(CFStringRef, Boolean);
void* sbServices = dlopen("/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices", RTLD_LAZY);
openApp= (int(*)(CFStringRef, Boolean))dlsym(sbServices,"SBSLaunchApplicationWithIdentifier");
openApp(CFSTR("com.apple.mobilephone"), FALSE);
dlclose(sbServices);

This is working fine in a simulator but on the device it is giving following error:

com.apple.springboard.launchapplications required to use kern_return_t _SBXXLaunchApplication(mach_port_t, char *, sbs_url_string_t, sbs_property_list_data_t, mach_msg_type_number_t, sbs_property_list_data_t, mach_msg_type_number_t, SBSApplicationLaunchFlags, SBSApplicationLaunchError *, audit_token_t)

Is there any solution for the above problem?

Upvotes: 0

Views: 59

Answers (1)

Mohammad Rabi
Mohammad Rabi

Reputation: 1412

Better use [[UIApplication sharedApplication] openUrl:[NSURL URLWithString:@"YOUR URL"]]; You'll need set a custom URL scheme in your second app for that. Check this tutorial or simply do a search with "iphone custom URL schemes". There's a lot of good tutorials.

Upvotes: 1

Related Questions