ios - 在 iphone 中启动没有 URL 架构的其他应用程序?

标签 ios xcode jailbreak iphone-privateapi

我知道其他应用程序可以通过 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/

相关文章:

ios - 如何管理 iOS apns token 更改

ios - UITableView numberOfRows

ios - phonegap Inappbrowser 不显示位置栏(ios)

ios - 适用于 IOS 的 Unity IAP — 未找到应用程序收据

php - 无法清除错误从类型 '(_, _, _) throws -> ()' 的抛出函数到非抛出函数类型的无效转换

iphone - xcode 4 无缘无故提示 key 是 'undeclared identifier'

ios - 在越狱的应用程序中以编程方式编辑 Info.plist

ios - 使用 task_for_pid() 越狱开发者 iPhone

ios - Branch.io 仅在应用程序已存在于设备中时才重定向到应用程序商店

ios - 检索 vm 统计信息时 64 位 iOS 设备上的奇怪行为