objective c - iOS : Present a notification when the background treatment is finished -


i want display user notification displayed when application ends background treatment.

this code use :

uilocalnotification* localnotification = [[uilocalnotification alloc]init]; localnotification.alertbody = @"your uploads finished"; [[uiapplication sharedapplication]presentlocalnotificationnow:localnotification]; 

but not works, when called endbackgroundtask, don't see notification. however, used breakpoints, , code executed.

   //identify application state through local notification    uiapplicationstate state = [[uiapplication sharedapplication] applicationstate];   if (state==uiapplicationstateinactive)   {                     //show notification text voice                     uilocalnotification *notification = [[uilocalnotification alloc]init];                     [notification setalertbody:"title"];                     notification.soundname = uilocalnotificationdefaultsoundname;                     notification.alertaction = @"view";                     [[uiapplication sharedapplication] schedulelocalnotification:notification];                 } 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -