1

Is it possible to get the badge value of another iOS application?

For example, if I want my app to know how much unread messages the user has, can I simply look at the badge of the message application and read the integer value?

fredpi
  • 8,414
  • 5
  • 41
  • 61

1 Answers1

1

No this is not possible, your app is sandboxed and can not acces other apps.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • 1
    Ok thank you; but is there any possibility to just get the number of the unread messages, independently from the applications badge? – fredpi Feb 09 '15 at 14:24
  • No, there is no API that allows this – rckoenes Feb 09 '15 at 15:18
  • 1
    Whilst you are correct that my app cannot access the badge number of other apps, indeed it is possible to get the currently running apps: http://stackoverflow.com/questions/4312613/can-we-retrieve-the-applications-currently-running-in-iphone-and-ipad – return true Feb 09 '15 at 16:19
  • @returntrue that code is not really App Store save. – rckoenes Feb 09 '15 at 16:20
  • 1
    @rckoenes that code is perfectly App Store safe. It only makes use of sys/sysctl.h which is a public C API. – davidf2281 Feb 10 '15 at 13:03
  • @davidf2281yes you might be right about that, looks like it might actually work. Not sure if the review board will allow it, since they are a bit picky about it. – rckoenes Feb 10 '15 at 13:07