简体   繁体   English

关于AWS Cognito identityId及其生成,唯一性的疑问?

[英]Queastions about the AWS Cognito identityId and its generation, uniqueness?

I am 100% new to AWS and to the AWS iOS SDK. 我100%接触AWS和AWS iOS SDK。

I am using The Standard AWS Code Example. 我正在使用标准AWS代码示例。 to initialize the Cognito credentials provider. 初始化Cognito凭据提供程序。 I of course am changing @"COGNITO_IDENTITY_POOL"]. 我当然在更改@“ COGNITO_IDENTITY_POOL”]。

I have noticed that when I do this the first time for a device that NSString *cognitoId = credentialsProvider.identityId; 我已经注意到,当我第一次为NSString *cognitoId = credentialsProvider.identityId;的设备执行此操作时, is nil. 是零。 Is this to be expected? 这是可以预期的吗? if so at what time is the property available? 如果可以,该物业什么时候可用?

Also is my understanding correct that the SDK saves this Cognito ID in the devices key chain? 我的理解是否也正确,因为SDK将这个Cognito ID保存在设备密钥链中? Thus this identity will not change for the device while ever the user backs up his operating system. 因此,即使用户备份其操作系统,该身份对于设备也不会更改。 If for example he wipes his device and freshly installs iOS then a new ID (same app same Congnito pool) will be generated? 例如,如果他擦拭设备并重新安装iOS,那么会生成一个新ID(相同的应用程序和相同的Congnito池)吗? If however he just deletes my App but later installs it again (no change to iOS), then if I use the same Cognito pool he will be recognized as an existing member with the same ID? 但是,如果他只是删除了我的应用程序,但后来又重新安装了它(对iOS不变),那么如果我使用相同的Cognito池,他会被识别为具有相同ID的现有成员吗?

"credentialsProvider.identityId" is null the first time you use the SDK, until it gets refreshed. 首次使用SDK时,“ credentialsProvider.identityId”为null,直到刷新为止。 Once you get an identity from the service, it will get stored in the keychain and the device will always reuse the same one (unless, as you said, the user clears the keychain or wipes the device). 一旦从服务中获得了身份,该身份将被存储在钥匙串中,并且设备将始终重复使用同一身份(除非您说过,否则用户会清除钥匙串或擦除设备)。

Albert 阿尔伯特

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM