首页 版块 访问AI主站 注册 发帖
曼巴不嗜血
17
积分 积分商城
0
获赞
iOS12.1使用百度语音无法播报
Ta的回复 :同样的问题
59
iOS12.1使用百度语音无法播报
Ta的回复 :iOS 12.1: 前台可以播放,后台播放也可以,合成语音之后不要立即播放,用AVAudiPlayer来播放,进入后台,APPDelegate里面申请下后台任务,就可以播放了,后台播放本地的视频也一样。杀进程播放暂时还没解决。公司内部应用,plist里面随便加,需要上架的,要另谋出路了。
59
iOS12 APNS无法语音播报
Ta的回复 :iOS 12.1 NotificationService不走,在我的工程里直接跑不起来,我怀疑是某个C++的库导致。如果是后台播报,可以在AppDelegate中申请后台任务,开启后台播放,NotificationService的target开启后台播放模式。 - (void)applicationWillResignActive:(UIApplication *)application {       //开启后台处理多媒体事件     [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];     AVAudioSession *session = [AVAudioSession sharedInstance];     [session setActive:YES error:nil];     //后台播放     [session setCategory:AVAudioSessionCategoryPlayback error:nil];     //申请后台任务id,程序长时间处于后台也可播放音频     self.bgTaskId = [AppDelegate backgroundPlayerID:self.bgTaskId]; } 并且在以下方法中区分下系统版本,还是可以实现前、后台、锁屏播报,但是杀进程播报还是解决不了 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { NSString *msg = LEmpty(userInfo[@"aps"][@"alert"]); //NotificationServiceiOS 10以上使用,但是在12.1及以上不会执行 //iOS 10以下、iOS 12.1以上直接播放 if (!iOS10_OR_LATER || ([[[UIDevice currentDevice] systemVersion] compare:@"12.1" options:NSNumericSearch] != NSOrderedAscending)) { //语音播报 [[VoiceBroadcastManager sharedInstance] playVoice:msg]; } else { //iOS 10以上 ~ iOS 12.1以下 走NotificationService }
3
iOS12.1使用百度语音无法播报
Ta的回复 :大佬协助下
59
iOS12.1使用百度语音无法播报
Ta的回复 :能否告知下如何解决的
59
iOS12.1使用百度语音无法播报
Ta的回复 :杀进程也能播放吗?
59
iOS12.1使用百度语音无法播报
Ta的回复 :VOIP这种推送模式,要单独搭推送服务器吧,不是聊天类的APP,不需要长连接,用不着这种推送模式。
59
切换版块
智能客服