Hi,
in authorize api callback of LWA in iOS i am getting error object in both cases when user simply cancel login by pressing 'done' button without entering credentials. And when user disagree(cancel) 'privacy notice' by pressing cancel after entering credentials. in both cases i am getting error object with error code 3 and 4. and in both case userDidCancel is true.
I have to differentiate in both cases. currently i am doing this by using error codes. I think in second case error object should not be nil. Please correct me if i am doing anything wrong. And suggest me the better option to differentiate both cases.
Ref:
<code>- (IBAction)onLogInButtonClicked:(id)sender { // Build an authorize request. AMZNAuthorizeRequest *request = [[AMZNAuthorizeRequest alloc] init]; request.scopes = [NSArray arrayWithObjects: // [AMZNProfileScope userID], [AMZNProfileScope profile], [AMZNProfileScope postalCode]]; // Make an Authorize call to the Login with Amazon SDK. [[AMZNAuthorizationManager sharedManager] authorize:request withHandler:^(AMZNAuthorizeResult *result, BOOL userDidCancel, NSError *error) { if (error) { // Handle errors from the SDK or authorization server. } else if (userDidCancel) { // Handle errors caused when user cancels login. } else { // Authentication was successful. // Obtain the access token and user profile data. NSString *accessToken = result.token; AMZNUser *user = result.user; NSString *userID = user.userID; } }]; }
Thanks and Regards
Usman Ansari