我知道其他应用程序可以通过 URL 架构从您的应用程序调用。但并不是所有的应用程序都注册了 schema URL。那么我该如何启动该应用程序呢? 我正在为 iphone jaibroken 开发。
最佳答案
您可以通过多种方式使用 Bundle ID 启动应用。
SB应用
SBApplication *app = [[objc_getClass("SBApplicationController") sharedInstance] applicationWithDisplayIdentifier:@"com.wrightscs.someapp"];
[[objc_getClass("SBUIController") sharedInstance] activateApplicationFromSwitcher: app];
SBApplicationController
SBUIController *uicontroller = (SBUIController *)[%c(SBUIController) sharedInstance];
SBApplicationController *appcontroller = (SBApplicationController *)[%c(SBApplicationController) sharedInstance];
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)])
{
[uicontroller activateApplicationFromSwitcher:[[appcontroller applicationsWithBundleIdentifier:bundleID] objectAtIndex:0]];
}
else
{
// doesn't work outside of Springboard
[uicontroller activateApplicationAnimated:[[appcontroller applicationsWithBundleIdentifier:bundleID] objectAtIndex:0]];
}
我在 4.x 和 SBUIController
中使用了另一种方法,但它在 5.0 中停止工作,所以我不打算发布它。
关于ios - 在 iphone 中启动没有 URL 架构的其他应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11693796/