I'm trying to register a device in Cognito from sign in in our iOS app with using the AWS Mobile SDK. I'm referencing the AWS blog post Tracking and Remembering Devices Using Amazon Cognito Your User Pools, but I am getting a null return and the device does not show up for the user in Cognito. The steps I followed are described in the AWS blog post and shown below. I also included the null return description. Can anyone help me understand what I am missing or suggest another way to try.
// User Sign In Functions
CognitoManager.shared.login(emailId, password: password, callback: { (success: Bool, error: NSError?) -> (Void) in
if(success)
{
let lc = LicenseCheck()
lc.getLicenseUserInfoAgain(_email: emailId)
let response = CognitoManager.shared.registerUser?.updateDeviceStatus(true)
print("response \(response)")
}
func updateDeviceStatus(_ email : String){
let user = pool!.getUser(email)
user.updateDeviceStatus(true)
let deviceToken = UserDefaults.standard.value(forKey: LoggedInUser.shared.deviceToken) as! String
let response = user.updateDeviceStatus(deviceToken, remembered: true)
response.continueOnSuccessWith { (task :AWSTask<AWSCognitoIdentityUserUpdateDeviceStatusResponse>) -> Any? in
guard task.error == nil else {
print("Error")
return nil
}
print("Success")
return nil
}
}
**// Return Value
response Optional(<AWSTask: 0x127644f50; completed = YES; cancelled = NO; faulted = YES; result = (null)>)**

