aws-sdk-ios
aws-sdk-ios copied to clipboard
How to get UUID after sign up with AWSMobileClient.sharedInstance().signUp
State your question From reading the docs, the sign up response should contain three properties:
{
"CodeDeliveryDetails": {
"AttributeName": "string",
"DeliveryMedium": "string",
"Destination": "string"
},
"UserConfirmed": boolean,
"UserSub": "string"
}
However, the signUp method returns the following struct which does not contain UUID:
public struct SignUpResult {
public let codeDeliveryDetails: UserCodeDeliveryDetails?
public let signUpConfirmationState: SignUpConfirmationState
internal init(signUpState: SignUpConfirmationState, codeDeliveryDetails: UserCodeDeliveryDetails?){
self.codeDeliveryDetails = codeDeliveryDetails
self.signUpConfirmationState = signUpState
}
}
What is the right way to get the UUID?
Which AWS Services are you utilizing? Cognito
Provide code snippets (if applicable) As above
Environment(please complete the following information):
- SDK Version: 2.9.0
- Dependency Manager: Cocoapods
- Swift Version : 5
Device Information (please complete the following information):
- Device: n/a
- iOS Version: 12
- Specific to simulators: n/a
@vladspreys Thank you for reporting to us. The SignUpResult that is returned by AWSMobileClient.signUp method is a result object that lives in the AWSMobileClient SDK and is different from the SignUpResult that is returned by the Amazon Cognito User Pools service as part of the sign-up response.
If you take a look at https://github.com/aws-amplify/aws-sdk-ios/blob/master/AWSAuthSDK/Sources/AWSMobileClient/AWSMobileResults.swift#L205, you can see that it only has the confirmed status and user code delivery details and it misses userSub.
That said, I will tag this as an enhancement and talk to @rohandubal to see if we could surface this or not. Thank you for bringing this to our attention.
Any update on this? @rohandubal @kvasukib
Hey Guys,
Just to add more information,
Android SDK already has that value: https://github.com/aws-amplify/aws-sdk-android/blob/main/aws-android-sdk-mobile-client/src/main/java/com/amazonaws/mobile/client/results/SignUpResult.java
Do we have an estimated time to fix this issue?
Thanks in advance,
cc: @rohandubal , @kvasukib
Thanks for opening this issue and everyone's input. The userSub property has been added to SignUpResult -- this change will be included in the next release.