Wootric / WootricSDK-iOS

Wootric iOS SDK to show NPS, CSAT and CES surveys
MIT License
13 stars 24 forks source link

Fix authenticate when get/post end_users fails #80

Closed diegoserranoa closed 4 years ago

diegoserranoa commented 4 years ago

When GET/POST to /api/v1/end_users fails, do not show survey.

Changes

Test

To replicate bug on master, create new end user with incorrect property

  [Wootric configureWithAccountToken:accountToken];
  [Wootric setEndUserEmail:@"test@example.com"];;

  [Wootric setEndUserProperties:@{
    @"incorrect_property_date": @"2020-01-01"
  }];

  [Wootric showSurveyInViewController:self];

Now checkout this branch, if an error occurs, the survey shouldn't show up and you should see an error in the logs.

marinhero commented 4 years ago

This doesn't appear to be working for me :( Screen Shot 2020-08-11 at 4 15 21 PM

Please take a look and let me know what I might be missing

diegoserranoa commented 4 years ago

Thanks for the comments @hachibu and @marinhero

I updated the PR, think this is ready for another review.

marinhero commented 4 years ago

This works. Please update the description of the PR to reflect the new algorithm and 🐑 🇮🇹 . Well done!