Skip to content

Commit 12a8cd4

Browse files
Test
1 parent fcc90cd commit 12a8cd4

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

sample/Sample.Android/MainApplication.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public override void OnCreate()
3131
FirebasePushNotificationManager.DefaultNotificationChannelId = "FirebasePushNotificationChannel";
3232
FirebasePushNotificationManager.DefaultNotificationChannelName = "General";
3333
}
34-
3534
#if DEBUG
3635
NotifoFirebasePlugin.Initialize(this, new NotifoStartup(), new NotificationHandler(), resetToken: true);
3736
#else

sample/Sample.iOS/Application.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// All rights reserved. Licensed under the MIT license.
66
// ==========================================================================
77

8+
using Foundation;
89
using UIKit;
910

1011
#pragma warning disable SA1300 // Element should begin with upper-case letter

sample/Sample/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public static class Constants
1111
{
1212
public const string ApiUrl = "https://notifo.easierlife.com";
1313

14-
public const string UserApiKey = "mbgen4xlv2b9tgmxivtei8jxxa67qfa1zq0kumqpemyx";
14+
public const string UserApiKey = "y2giqssxfvun1mnkrweql9pt5hay1xzuv6dmasba9jax";
1515
}
1616
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ private async Task AddImageAsync(UNMutableNotificationContent content, UserNotif
239239
return;
240240
}
241241

242-
var attachmentName = $"{Guid.NewGuid()}{Path.GetExtension(imagePath)}";
242+
var attachmentName = Guid.NewGuid().ToString();
243243
var attachmentUrl = new NSUrl(attachmentName, NSFileManager.DefaultManager.GetTemporaryDirectory());
244244

245-
// TODO: We copy the image twice. Really weird.
246-
NSFileManager.DefaultManager.Copy(NSUrl.FromFilename(attachmentName), attachmentUrl, out var error);
245+
// The cache directory cannot be used.
246+
NSFileManager.DefaultManager.Copy(NSUrl.FromFilename(imagePath!), attachmentUrl, out var error);
247247

248248
if (error != null)
249249
{
@@ -303,7 +303,7 @@ public void DidReceiveNotificationResponse(UNNotificationResponse response)
303303
}
304304

305305
// Copy directly from the web stream to the image stream to reduce memory allocations.
306-
using (var fileStream = new FileStream(imagePath, FileMode.Open))
306+
using (var fileStream = new FileStream(imagePath, FileMode.Create))
307307
{
308308
using (var imageStream = await httpClient.GetStreamAsync(imageUrl))
309309
{

0 commit comments

Comments
 (0)