Closed aaronbrethorst closed 7 years ago
@aaronbrethorst Is it necessary to have the url presented to users? If removing the url will make it look better, I think I can fix this real quick.
Maybe log it in console, but don't show in alert
I've included a design and an alternative to the URL, which I agree is ugly.
The URL is ugly, but it's also been consistently the best way to diagnose and explain a couple classes of errors to users.
Design
We'll build a custom UI for the Swift Messages component. It'll use a light blur effect view as the background, have 16px borders around the edges, and a full width Dismiss button across the bottom separated from the rest of the UI by a 0.5px hairline.
This design will be used for all SwiftMessage-based alerts for the user, including errors and warnings. Ideally, we'd supply a tint color (red tint for errors, e.g.), but I don't think this is possible with
UIVisualEffectView
.Message Body
The error messages presented will replace the URL with a new
Reference
value. This reference value will be calculated from the first 10 digits of the SHA1 of the URL in question. This SHA1 value will be presented on screen and also logged with Crashlytics via its-recordError:withAdditionalUserInfo:
method. Specifically, the SHA1 will be included with the keyreference
. i.e.[Crashlytics sharedInstance recordError:error withAdditionalUserInfo:@{@"reference": [self calculateSHA1FromURL:URL]}];
Where the SHA1 calculation method grabs the first 10 characters from the method described here: https://stackoverflow.com/questions/7570377/creating-sha1-hash-from-nsstring
This could stand to look more polished :-\