Guest User

Untitled

a guest
Aug 10th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment