X

Primul widget custom facut pentru Notifications Center din iOS 5

V-am spus acum o ora ca teoretic ar fi posibila dezvoltarea de widget-uri pentru iOS 5 chiar si in lipsa unor programe puse la dispozitie de catre Apple si iata ca acum avem prima dovada ca widget-urile pentru Notifications Center pot fi foarte usor facute. Hello World este textul afisat de catre primul widget facut pentru Notifications Center si reprezinta doar o dovada a faptului ca prin Cydia vom putea instala widget-uri pentru anumite aplicatii chiar daca Apple nu va permite acest lucru.

Apple nu a anuntat oficial ca ar oferi dezvoltatorilor de aplicatii pentru iOS API-uri care sa el permita dezvoltarea de widget-uri pentru propriile aplicatii insa in final s-ar putea sa nu fie nevoie. Avem deja demonstrat faptul ca widiget-urile vor fi prezente in Notifications Center insa Apple poate implementa niste API-uri oficiale care ar permite oricaror dezvoltatori sa faca asemenea widget-uri si astfel am avea parte de mult mai multe aplicatii care ar avea aceasta functie inclusa. Pana una alta aici

aveti documentatia necesara pentru a afla cum sa faceti widget-uri pentru aplicatii.

Custom Notification Center Widgets (WeeApps) by @WillFour20

This is a very bare example of how to add a custom widget to the iOS 5 notification centre.

All it really does is say ‘Hello World’ for now.

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.

I don’t yet know how to set the name in the Settings.app but it seems that the icon shown is set by setting the app identifier in Info.plist of the app which icon you want. (e.g. to get your custom widget to have the Safari icon set the ‘AppBundleID’ in Info.plist to ‘com.apple.mobilesafari’)

Custom bundles are placed in /System/Library/WeeAppPlugins/

This is a pretty shitty example but i’m sure some great stuff can come out of this.

Problems:

This does not show up correctly in the Settings.app, it appears without a name and a messed up icon.

This post was last modified on iun. 10, 2011, 10:37 PM 22:37

Disqus Comments Loading...