1.在你的项目AppDelegate类(****AppDelegate.m)里面的- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOp tions:(NSDictionary
*)launchOptions函数里加入以下代码;
[[UIApplication sharedApplication] beginReceivingRemoteCont rolEvents];
[UIApplication
sharedApplication].statusBarStyle = UIStatusBarStyleBlackTra nslucent;
NSError
*setCategoryErr = nil;
NSError
*activationErr =
nil;
[[AVAudioSession
sharedInstance] setCategory:
AVAudioSessionCategoryPl ayback error:
&setCategoryErr];
[[UIApplication sharedApplication] beginReceivingRemoteCont
2.在你的“项目名-Info.plist”里面加入下面设置
本文介绍如何在iOS项目中配置状态栏样式、音频会话类别及激活状态等关键步骤,确保应用能够正确处理远程控制事件并拥有合适的音频设置。

371

被折叠的 条评论
为什么被折叠?



