Difference between revisions of "SBBulletinBannerController"

From iPhone Development Wiki
Jump to: navigation, search
(playLightsAndSirens is a BOOL argument and has to be true in order to receive notifications (Source: I was using this code and it never worked until i changed it to true))
m (Added navbox)
Line 14: Line 14:
[bulletin release];
[bulletin release];

Revision as of 02:49, 11 August 2015

SBBulletinBannerController can be used to post notifications to the user from a substrate tweak running inside Springboard.

BBBulletinRequest *bulletin = [[BBBulletinRequest alloc] init];  
bulletin.sectionID =  @"com.application.identifier";  
bulletin.title =  @"Title";  
bulletin.message  = @"Message";  
bulletin.date = [NSDate date];  
SBBulletinBannerController *controller = [%c(SBBulletinBannerController) sharedInstance];
if ([controller respondsToSelector:@selector(observer:addBulletin:forFeed:playLightsAndSirens:withReply:)])
  [controller observer:nil addBulletin:bulletin forFeed:2 playLightsAndSirens:YES withReply:nil]; 
else if ([controller respondsToSelector:@selector(observer:addBulletin:forFeed:)])
  [controller observer:nil addBulletin:bulletin forFeed:2];
[bulletin release];