Skip to content

Commit 631df87

Browse files
Added todos
1 parent d94279e commit 631df87

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

sdk/Notifo.SDK/Constants.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,43 @@ namespace Notifo.SDK
1010
internal static class Constants
1111
{
1212
public const string ApsAlertBodyKey = "aps.alert.body";
13+
1314
public const string ApsAlertTitleKey = "aps.alert.title";
15+
1416
public const string ApsKey = "aps";
17+
1518
public const string BodyKey = "body";
19+
1620
public const string ConfirmAction = "notifo-confirm-action";
21+
1722
public const string ConfirmTextKey = "confirmText";
23+
1824
public const string ConfirmUrlKey = "confirmUrl";
25+
1926
public const string ContentAvailableKey = "content-available";
27+
2028
public const string DataKey = "data";
29+
2130
public const string IdKey = "id";
31+
2232
public const string ImageLargeKey = "imageLarge";
33+
2334
public const string ImageSmallKey = "imageSmall";
35+
2436
public const string IsConfirmedKey = "isConfirmed";
37+
2538
public const string IsSeenKey = "isSeen";
39+
2640
public const string LinkAction = "notifo-link-action";
41+
2742
public const string LinkTextKey = "linkText";
43+
2844
public const string LinkUrlKey = "linkUrl";
45+
2946
public const string SilentKey = "silent";
47+
3048
public const string SubjectKey = "subject";
49+
3150
public const string TrackingUrlKey = "trackingUrl";
3251
}
3352
}

sdk/Notifo.SDK/NotifoMobilePush/NotifoMobilePushImplementation.ios.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,19 @@ private async Task<UNMutableNotificationContent> EnrichNotificationContentAsync(
154154
content.Body = notification.Body;
155155
}
156156

157-
string image = string.IsNullOrWhiteSpace(notification.ImageLarge) ? notification.ImageSmall : notification.ImageLarge;
157+
var image = string.IsNullOrWhiteSpace(notification.ImageLarge) ? notification.ImageSmall : notification.ImageLarge;
158158

159159
if (!string.IsNullOrWhiteSpace(image))
160160
{
161161
var imagePath = await GetImageAsync(image);
162162

163163
if (!string.IsNullOrWhiteSpace(imagePath))
164164
{
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());
167167

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);
169170

170171
if (error != null)
171172
{
@@ -174,7 +175,7 @@ private async Task<UNMutableNotificationContent> EnrichNotificationContentAsync(
174175

175176
var attachement = UNNotificationAttachment.FromIdentifier(
176177
Constants.ImageLargeKey,
177-
attachementUrl,
178+
attachmentUrl,
178179
new UNNotificationAttachmentOptions(),
179180
out error);
180181

@@ -290,7 +291,7 @@ private async Task<string> GetImageAsync(string imageUrl)
290291
{
291292
try
292293
{
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.
294295
if (imageCache.TryGetValue(imageUrl, out string imagePath) && File.Exists(imagePath))
295296
{
296297
return imagePath;

0 commit comments

Comments
 (0)