Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Providers/Resgrid.Providers.Bus/Models/ApnsHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public class ApnsHeader
public ApnsAlert alert { get; set; }
public string category { get; set; }
public int badge { get; set; }
public string sound { get; set; }
public ApnsSound sound { get; set; }
}
}
9 changes: 9 additions & 0 deletions Providers/Resgrid.Providers.Bus/Models/ApnsSound.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Resgrid.Providers.Bus.Models
{
public class ApnsSound
{
public float volume { get; set; }
public int critical { get; set; }
public string name { get; set; }
}
}
9 changes: 8 additions & 1 deletion Providers/Resgrid.Providers.Bus/NotificationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ public async Task<NotificationOutcomeState> SendAppleNotification(string title,
category = "chats";
else if (eventCode.ToLower().StartsWith("g")) // group chat
category = "chats";
else
category = "notifications";

var apnsPayload = new ApnsPayload
{
Expand All @@ -359,7 +361,12 @@ public async Task<NotificationOutcomeState> SendAppleNotification(string title,
},
badge = count,
category = category,
sound = GetSoundFileNameFromType(Platforms.iPhone, type)
sound = new ApnsSound
{
name = GetSoundFileNameFromType(Platforms.iPhone, type),
critical = category == "calls" ? 1 : 0,
volume = 1.0f
}
},
eventCode = eventCode,
type = type
Expand Down
9 changes: 8 additions & 1 deletion Providers/Resgrid.Providers.Bus/UnitNotificationProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ public async Task<NotificationOutcomeState> SendAppleNotification(string title,
category = "chats";
else if (eventCode.ToLower().StartsWith("g")) // group chat
category = "chats";
else
category = "notifications";

var apnsPayload = new ApnsPayload
{
Expand All @@ -354,7 +356,12 @@ public async Task<NotificationOutcomeState> SendAppleNotification(string title,
},
badge = count,
category = category,
sound = GetSoundFileNameFromType(Platforms.iPhone, type, enableCustomSounds)
sound = new ApnsSound
{
name = GetSoundFileNameFromType(Platforms.iPhone, type, enableCustomSounds),
critical = category == "calls" ? 1 : 0,
volume = 1.0f
}
},
eventCode = eventCode,
type = type
Expand Down