If I add an image to a notification then when its displayed as an icon in the notification compact state what is shown is just the the center of the image and not all of the image.
So I tried passing clipping options as below:
let clipping = CGRect(x: 0, y: 0, width: 1.0, height: 1.0)
let options: Dictionary<String, AnyObject> = [UNNotificationAttachmentOptionsThumbnailClippingRectKey: clipping.dictionaryRepresentation]
let icon = try UNNotificationAttachment(identifier: "icon", url: url, options: options)
But it made no difference.