notifications - How to locally notify in iPhone? -
i want notify user after specific time. there resources on topic? guides or sample code particularly helpful. have read number of sites it, server side notifications facebook notify if message arrives or that. want triggered locally iphone app no server involved.
yep! you're looking uilocalnotification
. once you've created 1 , configured it, can either present immediately or schedule appear @ point in time.
in other words:
//create notification uilocalnotification *notification = [[uilocalnotification alloc] init]; //configure (this sets message displayed) [notification setalertbody:@"this local notification!"]; //the notification show in 60 seconds [notification setfiredate:[nsdate datewithtimeintervalsincenow:60]]; //queue notification [[uiapplication sharedapplication] schedulelocalnotification:notification]; //release object no longer care [notification release];
that's there it, really.
Comments
Post a Comment