Hack Allows Custom Widgets To Be Created For Notification Center In iOS 5

iOS 5

Apple has integrated weather and stocks widget into the Notification Center in iOS 5, which gives users access to real-time weather and stock information from any application with a single swipe.

If you were disappointed that the widgets were limited only to weather and stocks, then we have some good news. Will Homer – a UK based iOS developer has figured out a way to hack iOS 5 to create widgets for Notification Center.

As an example, Homer has created a test widget, which says “Hello World”. He explains:

Its pretty easy to understand, you create a class that implements the BBWeeAppController protocol. The only required function you must have is ‘- (UIView *)view’ in which you must return the view that you want to appear. There are also other methods in the protocol for launching URLs when tapped and for rotation detection, view height, etc.

The i is set by settings the ‘AppBundleID’ key in the Info.plist file to an app id. The icon will then be the icon for that app (e.g. Setting ‘AppBundleID’ to ‘com.apple.mobilesafari’ will make your widget have the Safari icon). The name is set in the ‘InfoPlist.strings’ file.

You can checkout the screenshot below of the test plugin:

We were hoping that Apple would introduce dynamic home screen icons in iOS 5, which would display real-time information such as the current weather conditions rather than a fixed icon for the weather app. But the integration of widgets with the Notification screen that can be accessed from any app by swiping down on the status bar is also quite neat. By taking this approach, Apple has avoided unnecessary consumption of battery life and also allows users to access the information from any application with a single swipe. Custom widgets from the jailbreak community will make this feature even better. We’ve already seen Settings toggles integrated with Notification Center in iOS 5.

Are you looking forward to custom widgets in iOS 5? Let us know what you think in the comments.

[via Twitter (Will Homer), github]