http://stackoverflow.com/questions/4188848/uilocalnotification-custom-sound
[[UIApplication sharedApplication] cancelAllLocalNotifications];
UILocalNotification *push = [[UILocalNotification alloc] init];
push.fireDate = [NSDate dateWithTimeInterval:1 sinceDate:[NSDate date]];
push.alertBody = [NSString stringWithFormat:@"%@",bl.text];
//push.soundName = UILocalNotificationDefaultSoundName;//能夠播放系統(tǒng)默認(rèn)提示音;
//push.soundName = [[NSBundle mainBundle] pathForResource:@"pushSound" ofType:@"wav"];//用該方式獲取的文件無(wú)法正常播放
push.soundName = @"push.wav";//文件保存在source目錄下(放到其他工程目錄下也是可行的)
NSDictionary * dic = @{@"major":bl.major,@"minor":bl.minor,@"x":bl.x,@"y":bl.y};
push.userInfo = dic;
[[UIApplication sharedApplication] scheduleLocalNotification:push];
//push.soundName = [[NSBundle mainBundle] pathForResource:@"pushSound" ofType:@"wav"];//用該方式獲取的文件無(wú)法正常播放 push.soundName = @"pushSound.wav";//文件保存在source目錄下(放到其他工程目錄下也是可行的)
1.注意:音頻文件時(shí)長(zhǎng)需要小于30秒的件缸。锌妻。
2.擴(kuò)展思考下:能否使用Doucument目錄下自己錄制生成的音頻文件來(lái)作為推送提示音