ios appkill下铃声自定义

182 阅读1分钟

(1)放到工程中 
(2)放到沙盒里面的Library里面的Sounds文件夹中(如果Library中没有Sounds文件夹,需要创建之后再把音频文件放进去),音频文件按照这个路径放好之后就可以设置自定义通知声音了 

 UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; content.title = [NSString localizedUserNotificationStringForKey:@"" arguments:nil]; content.body = [NSString localizedUserNotificationStringForKey:@"xxx" arguments:nil]; // 使用diy声音 content.sound=[UNNotificationSound soundNamed:@"unbelievable.caf"];  这里是直接识别的。已测试