IOS AudioServicesPlaySystemSound 后台锁屏播放

本文探讨了在iOS设备上实现在锁屏状态下后台播放报警提示音的方法。文章详细记录了作者尝试使用AudioServicesPlaySystemSound遇到的问题及Apple官方审核反馈,并最终通过Notification方法解决了这一难题。

AudioServicesPlaySystemSound

 想在锁屏后台播放报警提示音。

添加了UIBackgroundModes,audio,官方审核不通过!

IOS的闹钟是怎么实现的,锁屏不能播放声音?原来是用了notification方法。

http://zhangmingwei.iteye.com/blog/1831378

 

notification.soundName= UILocalNotificationDefaultSoundName;//声音,可以换成alarm.soundName = @"myMusic.caf"

 

 

From Apple
  • 2.16 - Multitasking Apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc.

2.16 Details

Your app declares support for audio in the UIBackgroundModes key in your Info.plist but did not include features that require persistent audio.

Specifically, playing an alert or act as an alarm for the hardware is not appropriate for the app to use background audio functionality.

Next Steps

The audio key is intended for use by applications that provide audible content to the user while in the background, such as music player or streaming audio applications.

Please revise your app to provide audible content to the user while the app is in the background or remove the "audio" setting from the UIBackgroundModes key.

Resources

If you have difficulty reproducing a reported issue, please try testing the workflow described in Technical Q&A QA1764: How to reproduce bugs reported against App Store submissions.

If you have code-level questions after utilizing the above resources, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
- complete details of your rejection issue(s)
- screenshots
- steps to reproduce the issue(s)
- symbolicated crash logs - if your issue results in a crash log

 

转载于:https://www.cnblogs.com/cb168/p/5338098.html

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值