@@ -154,18 +154,19 @@ private async Task<UNMutableNotificationContent> EnrichNotificationContentAsync(
154
154
content . Body = notification . Body ;
155
155
}
156
156
157
- string image = string . IsNullOrWhiteSpace ( notification . ImageLarge ) ? notification . ImageSmall : notification . ImageLarge ;
157
+ var image = string . IsNullOrWhiteSpace ( notification . ImageLarge ) ? notification . ImageSmall : notification . ImageLarge ;
158
158
159
159
if ( ! string . IsNullOrWhiteSpace ( image ) )
160
160
{
161
161
var imagePath = await GetImageAsync ( image ) ;
162
162
163
163
if ( ! string . IsNullOrWhiteSpace ( imagePath ) )
164
164
{
165
- var uniqueName = $ "{ Guid . NewGuid ( ) } { Path . GetExtension ( imagePath ) } ";
166
- var attachementUrl = new NSUrl ( uniqueName , NSFileManager . DefaultManager . GetTemporaryDirectory ( ) ) ;
165
+ var attachmentName = $ "{ Guid . NewGuid ( ) } { Path . GetExtension ( imagePath ) } ";
166
+ var attachmentUrl = new NSUrl ( attachmentName , NSFileManager . DefaultManager . GetTemporaryDirectory ( ) ) ;
167
167
168
- NSFileManager . DefaultManager . Copy ( NSUrl . FromFilename ( imagePath ) , attachementUrl , out var error ) ;
168
+ // TODO: We copy the image twice. Really weird.
169
+ NSFileManager . DefaultManager . Copy ( NSUrl . FromFilename ( imagePath ) , attachmentUrl , out var error ) ;
169
170
170
171
if ( error != null )
171
172
{
@@ -174,7 +175,7 @@ private async Task<UNMutableNotificationContent> EnrichNotificationContentAsync(
174
175
175
176
var attachement = UNNotificationAttachment . FromIdentifier (
176
177
Constants . ImageLargeKey ,
177
- attachementUrl ,
178
+ attachmentUrl ,
178
179
new UNNotificationAttachmentOptions ( ) ,
179
180
out error ) ;
180
181
@@ -290,7 +291,7 @@ private async Task<string> GetImageAsync(string imageUrl)
290
291
{
291
292
try
292
293
{
293
- // Not really sure if the dictionary provides any value at all.
294
+ // TODO: Not really sure if the dictionary provides any value at all.
294
295
if ( imageCache . TryGetValue ( imageUrl , out string imagePath ) && File . Exists ( imagePath ) )
295
296
{
296
297
return imagePath ;
0 commit comments