GCKCredentialsData 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
一个类,用于维护特定于应用的凭据数据,以识别用户身份并可能对用户进行身份验证。
- 开始时间
- 4.4.8
此类继承 NSObject。
- (instancetype) initWithCredentials: |
|
(NSString *_Nullable) |
credentials |
|
使用指定凭据初始化并返回新分配的 GCKCredentialsData
对象。
系统会将 credentialsType
分配为默认值“ios”,以表明其来自 iOS 发送者。
- Parameters
-
credentials | A string to identify and possibly authenticate the user. May be nil . |
- (instancetype) initWithCredentials: |
|
(NSString *_Nullable) |
credentials |
credentialsType: |
|
(NSString *_Nullable) |
credentialsType |
|
|
| |
使用指定的凭据和凭据类型初始化并返回新分配的 GCKCredentialsData
对象。
- Parameters
-
credentials | A string to identify and possibly authenticate the user. May be nil . |
credentialsType | A string to identify the type of the credentials. May be nil . |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003e\u003ccode\u003eGCKCredentialsData\u003c/code\u003e stores application-specific credentials to identify and potentially authenticate users.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to initialize with credentials and a credentials type (defaulting to "ios" if not specified).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecredentials\u003c/code\u003e and \u003ccode\u003ecredentialsType\u003c/code\u003e properties can be accessed to retrieve the stored values.\u003c/p\u003e\n"],["\u003cp\u003eThis class is available since Google Cast SDK v4.4.8.\u003c/p\u003e\n"]]],["The `GCKCredentialsData` class manages application-specific user credentials. Key actions include initializing the class instance via `-init`, `-initWithCredentials:` or `-initWithCredentials:credentialsType:`. Initialization allows setting credentials, a string for user identification and possible authentication, and optionally, `credentialsType`, identifying the credential type. The default `credentialsType` is \"ios\". The class also has read only methods `credentials` and `credentialsType` to retrieve those stored data.\n"],null,["# GCKCredentialsData Class\n\n[Instance Methods](#pub-methods) \nGCKCredentialsData Class Reference \n\nOverview\n--------\n\nA class to maintain the application specific credentials data to identify and possibly authenticates the user.\n\nSince\n: 4.4.8\n\nInherits NSObject.\n\n|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (instancetype) | - **init** |\n| ||\n| (instancetype) | - [initWithCredentials:](/cast/docs/reference/ios/interface_g_c_k_credentials_data#ada5bd74b764e23bfc36563e8166aa5e5) |\n| | Initializes and returns a newly allocated [GCKCredentialsData](/cast/docs/reference/ios/interface_g_c_k_credentials_data \"A class to maintain the application specific credentials data to identify and possibly authenticates ...\") object with the specified credentials. [More...](#ada5bd74b764e23bfc36563e8166aa5e5) |\n| ||\n| (instancetype) | - [initWithCredentials:credentialsType:](/cast/docs/reference/ios/interface_g_c_k_credentials_data#af54f24138f866978440e36d5af449ae8) |\n| | Initializes and returns a newly allocated [GCKCredentialsData](/cast/docs/reference/ios/interface_g_c_k_credentials_data \"A class to maintain the application specific credentials data to identify and possibly authenticates ...\") object with the specified credentials and credentials type. [More...](#af54f24138f866978440e36d5af449ae8) |\n| ||\n| (NSString \\*_Nullable) | - **credentials** |\n| ||\n| (NSString \\*_Nullable) | - **credentialsType** |\n| ||\n\nMethod Detail\n-------------\n\n|---------------------------------------|---|------------------------|---------------|---|\n| - (instancetype) initWithCredentials: | | (NSString \\*_Nullable) | *credentials* | |\n\nInitializes and returns a newly allocated [GCKCredentialsData](/cast/docs/reference/ios/interface_g_c_k_credentials_data \"A class to maintain the application specific credentials data to identify and possibly authenticates ...\") object with the specified credentials.\n\nThe `credentialsType` is assigned \"ios\" as default value to indicate it comes from an iOS sender.\n\nParameters\n:\n\n |-------------|------------------------------------------------------------------------|\n | credentials | A string to identify and possibly authenticate the user. May be `nil`. |\n\n\n|--------------------------------------------------------------------------------------------------------------------------------------|---|------------------------|-------------------|\n| - (instancetype) [initWithCredentials:](/cast/docs/reference/ios/interface_g_c_k_credentials_data#ada5bd74b764e23bfc36563e8166aa5e5) | | (NSString \\*_Nullable) | *credentials* |\n| credentialsType: | | (NSString \\*_Nullable) | *credentialsType* |\n| | | | |\n\nInitializes and returns a newly allocated [GCKCredentialsData](/cast/docs/reference/ios/interface_g_c_k_credentials_data \"A class to maintain the application specific credentials data to identify and possibly authenticates ...\") object with the specified credentials and credentials type.\n\nParameters\n:\n\n |-----------------|------------------------------------------------------------------------|\n | credentials | A string to identify and possibly authenticate the user. May be `nil`. |\n | credentialsType | A string to identify the type of the credentials. May be `nil`. |"]]