简体   繁体   中英

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

I am 100% new to AWS and to the AWS iOS SDK.

I am using The Standard AWS Code Example. to initialize the Cognito credentials provider. I of course am changing @"COGNITO_IDENTITY_POOL"].

I have noticed that when I do this the first time for a device that 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? 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? 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?

"credentialsProvider.identityId" is null the first time you use the SDK, until it gets refreshed. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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