ios – 由于“GCKConnectionSuspendReasonNetworkNotReachable”导致会话暂停

ios – 由于“GCKConnectionSuspendReasonNetworkNotReachable”导致会话暂停,第1张

概述观察到的行为:在开始播放音乐文件后,用户进入后台.通过强制转换播放音乐文件几分钟后,会话暂停,原因是GCKConnectionSuspendReasonNetworkNotReachable,即使发送方设备和强制转换设备都连接到正常工作的Wi-Fi连接 预期行为:会话应该继续,因为发送方应用程序具有播放音频的后台功能,并且GCKCastOptions我们已将属性suspendSessionsWhe 观察到的行为:在开始播放音乐文件后,用户进入后台.通过强制转换播放音乐文件几分钟后,会话暂停,原因是GCKConnectionSuspendReasonNetworkNotReachable,即使发送方设备和强制转换设备都连接到正常工作的Wi-Fi连接

预期行为:会话应该继续,因为发送方应用程序具有播放音频的后台功能,并且GCKCastoptions我们已将属性suspendSessionsWhenBackgrounded设置为NO.

解决方法 您可能想要检查在 GCKRemoteDisplayChannel Class中应用程序后台后恢复

据说,

normally when an iOS app goes to the background,all network connections are closed and all harDWare encoder access is terminated. This effectively means that without special handling a Remote display session will end upon app backgrounding.

A session can be kept alive in the background by doing the following:

Initialize the 07001 with initWithDevice:clIEntPackagename:ignoreAppStateNotifications:,specifying YES as the ignoreAppStateNotifications argument. Register a background task using UIApplication beginBackgroundTaskWithExpirationHandler: to keep the app running if it is backgrounded for an amount of time controlled by iOS.

有关更多信息,您可能还需要检查Playing media while in the background using AV Foundation on iOS.

总结

以上是内存溢出为你收集整理的ios – 由于“GCKConnectionSuspendReasonNetworkNotReachable”导致会话暂停全部内容,希望文章能够帮你解决ios – 由于“GCKConnectionSuspendReasonNetworkNotReachable”导致会话暂停所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1001407.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存