Hello,
First, you can change the UNAuthorizationOptions for Sound option in FinishedLaunching
method (I also add Badge option)
UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Badge| UNAuthorizationOptions.Sound| UNAuthorizationOptions.Alert , (approved, err) => {
// Handle approval
});
Then, you can handle Sound option in WillPresentNotification
completionHandler(UNNotificationPresentationOptions.Sound| UNNotificationPresentationOptions.Badge|UNNotificationPresentationOptions.Banner|UNNotificationPresentationOptions.List);
You are pushing Remote Notifications via Azure PlayFab, so you should check if there is a sound
key in the Notification Content, please refer to Generating a remote notification | Apple Developer Documentation, for example:
{
"aps":{
"alert":{
"title":"Notification Title",
"subtitle":"Notification Subtitle",
"body":"This is the message body of the notification."
},
"badge":1,
"sound": "default"
}
}
And you need register remote notification in FinishedLaunching
method UIApplication.SharedApplication.RegisterForRemoteNotifications ();
After that, you can uninstall the app and deploy the app on your device again. (Make sure the ability to play sounds has been allowed on your device in Settings->your app->Notification)
In addition, you can test whether there is sound when you push a LocalNotification, see the invoke platform code to send local notification for testing part in the previous thread. (If there is sound in Local Notification but not Remote Notifications, you might need the further help from Azure PlayFab support. If you have any other issues, please feel free to post here)
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.