daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. How to repeat a UILocalNotification Sound [closed]
  2. -(IBAction) scheduleNotification1 {
  3.  
  4.     local1 = [[UILocalNotification alloc] init];
  5.  
  6.     // create date/time information
  7.     local1.fireDate = [NSDate dateWithTimeIntervalSinceNow:2];
  8.     local1.timeZone = [NSTimeZone defaultTimeZone];
  9.  
  10.     // set notification details
  11.     local1.alertBody = @"2!";
  12.     local1.alertAction = @"View";
  13.  
  14.  
  15.     //local1.soundName = UILocalNotificationDefaultSoundName;
  16.      //local1.soundName = @"alarmsound.caf";
  17.     local1.soundName = @"29.mp3";
  18.     // set the badge on the app icon
  19.     local1.applicationIconBadgeNumber = 1;
  20.  
  21.     // local1.repeatInterval =NSSecondCalendarUnit;////    NSMinuteCalendarUnit;
  22.     //local1.repeatInterval =1 ;
  23.     // Gather any custom data you need to save with the notification
  24.     NSDictionary *customInfo = [NSDictionary dictionaryWithObject:@"ABCD2" forKey:@"yourKey1"];
  25.  
  26.     local1.userInfo = customInfo;
  27.  
  28.     // Schedule it!
  29.     [[UIApplication sharedApplication] scheduleLocalNotification:local1];
  30.  
  31.     //[local1 release];
  32.  
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top