【问题标题】:Is there a way to get Bundle ID of current open app有没有办法获取当前打开的应用程序的 Bundle ID
【发布时间】:2013-01-03 04:21:26
【问题描述】:

我正在使用 Theos 开发越狱调整,我需要获取当前打开的应用程序的 Bundle ID。我正在修改 SBBannerView.h 这是一个 SpringBoard 标头。我试过使用:

[[NSBundle mainBundle] bundleIdentifier]

还有:

[NSBundle mainBundle].bundleIdentifier

这两者都应该给出应用程序的捆绑标识符,但因为我正在修改 iOS 横幅通知,我认为它总是返回 com.apple.springboard 因为那是调用通知的对象

如何获取屏幕上显示的当前应用程序的应用程序包 ID?

例如,如果我打开 Settings.app,我会挂钩或调用什么来获取捆绑 ID com.apple.Preferences

对不起,如果我解释得不好

感谢大家的帮助

【问题讨论】:

    标签: iphone ios5 theos


    【解决方案1】:

    我想通了,对于任何试图实现这一点的人来说:

    SBApplication *frontApp = [(SpringBoard*)[UIApplication sharedApplication] _accessibilityFrontMostApplication];
    NSString *currentAppDisplayID = [frontApp displayIdentifier];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-26
      • 1970-01-01
      • 2010-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-30
      相关资源
      最近更新 更多