GCKOpen网址Options 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
一个对象,表示可通过深层链接网址传递给支持 Cast 的应用的选项。
源应用使用 asURLQueryItem (GCKOpenURLOptions) 在应用网址的查询参数中编码 Cast 专用选项(包括要投射到的设备的唯一 ID,以及要加入的特定 Cast 会话的会话 ID),然后使用 UIApplication 的 -[openURL:options:completionHandler:]
方法打开该网址。目标应用通过调用 openURLOptionsFromURL: (GCKOpenURLOptions) 从其 UIApplicationDelegate 的 -[application:openURL:options:]
方法中收到的网址中提取 Cast 专用选项。然后,通过将这些选项传递给 startSessionWithOpenURLOptions:sessionOptions: (GCKSessionManager),它启动或加入 Cast 会话。
- 开始时间
- 4.0
继承 NSObject、<NSCopy> 和 <NSSecureCoding>。
从指定网址中提取 Cast 专用选项。
- 返回
- 提取的选项,或者如果网址不包含任何 Cast 专用选项,则为
nil
。
- (NSURLQueryItem *) asURLQueryItem |
|
|
|
将选项转换为网址查询项。
- 返回
- 作为 NS网址QueryItem 的选项。
- (NSString*) deviceUniqueID |
|
readwritenonatomiccopy |
- (NSString*) deviceFriendlyName |
|
readwritenonatomiccopy |
要连接到的设备的易记名称。
可选。GoogleCast 框架不会使用此值,但接收应用可能会关注该值。
要加入的 Cast 会话的会话 ID。
可选。值 nil
表示应加入任何当前处于活动状态的会话;如果还没有,应创建新的会话。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-02。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2023-12-02。"],[[["`GCKOpenURLOptions` enables deep-linking to Cast-enabled applications by encoding Cast-specific options within a URL."],["Source applications use `asURLQueryItem` to create the URL and `openURL:options:completionHandler:` to open it, while target applications use `openURLOptionsFromURL:` to extract the options."],["Key options include `deviceUniqueID` (required), `deviceFriendlyName` (optional), and `sessionID` (optional for joining existing or starting new sessions)."],["Developers can utilize these options with `startSessionWithOpenURLOptions:sessionOptions:` to initiate or join Cast sessions seamlessly."]]],["The GCKOpenURLOptions class manages options for Cast-enabled apps via deep-link URLs. Source apps encode Cast options (device ID, optional session ID) into a URL query item using `asURLQueryItem`. The receiving app extracts these options using `openURLOptionsFromURL:`. This class enables the receiver to start or join a Cast session by providing these options to `startSessionWithOpenURLOptions:sessionOptions:`. Key properties include `deviceUniqueID`, `deviceFriendlyName`, and `sessionID`, enabling connection to a specific device or session.\n"]]