Exception or Stack Trace
at Microsoft.Azure.NotificationHubs.NotificationHubClient.d201.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.NotificationHubs.NotificationHubClient.<>cDisplayClass189_0.<b0>d.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.d41.MoveNext() at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.<RunOperation>d__41.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.NotificationHubs.NotificationHubClient.d__189.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at AzureHubsDebug.Form2.d__2.MoveNext() in C:_git\app-admintools\DebugPushApp\AzureHubWinFormsDebug\AzureHubsDebug\Form2.cs:line 39
To Reproduce
Create an Apple notification and replace the sound string with a sound dictionary as per the Apple documentation linked above.
Code Snippet
The following sound string works:
{ "aps":{ "alert":{ "body":"message body", "title":"message title" }, "sound":"custom_sound.wav" } }
The following sound dictionary does not work:
{ "aps":{ "alert":{ "body":"message body", "title":"message title" }, "sound":{ "critical": 1, "name":"custom_sound.wav", "volume": 1.0 } } }
Expected behavior
Azure hubs should accept sound as either a string or a dictionary as per the Apple documentation linked above.
Screenshots
N/A
Setup (please complete the following information):
IDE : Visual Studio 2019 v 16.9.5
Version of the Library used: Microsoft.Azure.NotificationHubs v 4.1.0
Additional context
N/A
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
Describe the bug In an Apple notification, when using the sound dictionary rather than the sound string (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification#2990112), the hub (SendDirectNotificationAsync) throws an exception.
Exception or Stack Trace at Microsoft.Azure.NotificationHubs.NotificationHubClient.d201.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.NotificationHubs.NotificationHubClient.<>cDisplayClass189_0.<b0>d.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.d 4d__189.MoveNext()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at AzureHubsDebug.Form2.d__2.MoveNext() in C:_git\app-admintools\DebugPushApp\AzureHubWinFormsDebug\AzureHubsDebug\Form2.cs:line 39
1.MoveNext() at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.<RunOperation>d__4
1.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.NotificationHubs.NotificationHubClient.To Reproduce Create an Apple notification and replace the sound string with a sound dictionary as per the Apple documentation linked above.
Code Snippet The following sound string works:
{ "aps":{ "alert":{ "body":"message body", "title":"message title" }, "sound":"custom_sound.wav" } }
The following sound dictionary does not work:
{ "aps":{ "alert":{ "body":"message body", "title":"message title" }, "sound":{ "critical": 1, "name":"custom_sound.wav", "volume": 1.0 } } }
Expected behavior Azure hubs should accept sound as either a string or a dictionary as per the Apple documentation linked above.
Screenshots N/A
Setup (please complete the following information):
Additional context N/A
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report