title: UILocalNotification repeat sound
body: <p>I have used the code from apples example from this page: <a href="http://developer.apple.com/iphone/library/documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW13" rel="nofollow noreferrer">Link</a>, but I can't seem to get the sound to repeat. I have checked other applications, such as skype (for VOIP) and Alarm Clock Pro (audio?) but I cannot get the sound file to be repeated.</p>
  
  <p>This is my code:</p>
  
  <pre><code>- (void)applicationDidEnterBackground:(UIApplication *)application
  {
      AlarmHandler *AHinstance = getAlarmHandlerInstance();
      UIApplication* app = [UIApplication sharedApplication];
  
      NSArray *alarmList          = [AHinstance getAlarms];
      NSArray *oldNotifications   = [app scheduledLocalNotifications];
  
      if ([oldNotifications count] &gt; 0)
      {
          [app cancelAllLocalNotifications];
      }
  
      for (Alarm *theAlarm in alarmList) {
          NSDate *alarmDate = [theAlarm getNearestActivationDate];
          Package *alarmPackage = [theAlarm getAlarmPackage];
          NSArray *fileList = [alarmPackage getVoiceFileListForBackgroundNotificationWithHour:theAlarm.larmHour];
  
          if( alarmDate == nil ) continue;
  
          UILocalNotification* alarm = [[[UILocalNotification alloc] init] autorelease];
  
          if (alarm)  
          {
              NSLog(@"File: %@", [fileList objectAtIndex:0]);
  
              alarm.fireDate = alarmDate;
              alarm.timeZone = [NSTimeZone defaultTimeZone];
              alarm.soundName = [fileList objectAtIndex:0];           
              alarm.alertBody = @"Time to wake up!";
              alarm.repeatInterval = 0;
  
              [app scheduleLocalNotification:alarm];
          }
      }
  }
  </code></pre>
  
  <p>Any suggestions on how I can fix this?</p>
  
  <p>I have had suggestions to register app as audio player and play sounds in the background, but it seems that apple does take kindly to those applications because they aren't real audio players. Therefore they deny those apps.</p>
  
  <p>Regards,<br/>
  Paul Peelen</p>