【问题标题】:iOS 14 - LNA permission not prompted when using custom cast dialogiOS 14 - 使用自定义投射对话框时未提示 LNA 权限
【发布时间】:2021-01-23 00:56:08
【问题描述】:

我们使用GCKUICastButton 并设置

triggersDefaultCastDialog = false

显示自定义接收者列表。我们不设置disableDiscoveryAutostartstartDiscoveryAfterFirstTapOnCastButton

我们希望当用户第一次选择投射按钮时,他们会得到局域网权限提示。但是,我们永远不会收到提示。为了得到提示,我们必须调用startDiscovery()

这是预期的行为吗?如果没有,我们在实现中是否遗漏了什么?

【问题讨论】:

    标签: swift google-cast ios14


    【解决方案1】:

    如果您在应用中构建了自定义设备选择器,则需要显式调用 GCKDiscoveryManager 类的 startDiscovery 方法来启动设备发现。从 Cast SDK 的 v4.5.0 版本开始,默认情况下已禁用自动扫描。 https://developers.google.com/cast/docs/ios_sender/ios_permissions_changes#updating_your_app_on_ios_14

    【讨论】:

    • Per that doc: By default, Cast device discovery is initiated the first time the user taps the Cast button (GCKUICastButton). If it's the first time the user has attempted to use the Cast app on the local network after upgrading to iOS 14, the new LNA interstitial will appear, followed by the iOS Local Network Access permissions dialog. 它没有说任何关于自定义演员对话的内容,所以我只想澄清这种预期的行为,而不是实现中的错误。或者即使预期有一种方法可以请求自定义对话框支持默认扫描行为。
    猜你喜欢
    • 2017-02-20
    • 2012-06-13
    • 2016-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-06
    相关资源
    最近更新 更多