J'ai utilisé le code de pommes exemple de cette page: Link, mais je ne peux pas sembler obtenir le son à répéter. J'ai vérifié d'autres applications, telles que skype (VoIP) et Alarm Clock Pro (audio?) Mais je ne peux pas obtenir le fichier son à répéter.son de répétition UILocalNotification
Voici mon code:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
AlarmHandler *AHinstance = getAlarmHandlerInstance();
UIApplication* app = [UIApplication sharedApplication];
NSArray *alarmList = [AHinstance getAlarms];
NSArray *oldNotifications = [app scheduledLocalNotifications];
if ([oldNotifications count] > 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];
}
}
}
Toutes les suggestions sur la façon dont je peux résoudre ce problème?
J'ai eu des suggestions pour enregistrer l'application en tant que lecteur audio et lire des sons en arrière-plan, mais il semble que la pomme ne prend gentiment à ces applications, car ils ne sont pas de vrais joueurs audio. Par conséquent, ils nient ces applications.
Cordialement,
Paul Peelen
mec, est votre application complète maintenant ...? En fait je suis également confronté au même problème que je veux que mon son de notification se répète 3 fois car mon son est de 20 sec. Pouvez-vous m'aider..? S'il vous plaît – mAc
Eh bien, j'ai trouvé ce n'est pas possible, comme l'a dit Itay. Vous devrez ajouter 3 fois le même son dans un fichier ou 3 notifications. –
@PaulPeelen vous avez une solution? – Abha