Hi
I have a strange problem. I want to play notification sounds when app is active, and when in background too, but now, i dont know why the custom sounds played only when app is in background.
Here is my code
var content = new UNMutableNotificationContent { Title = title, Subtitle = "", Body = message }; if (!string.IsNullOrEmpty(soundFileName)) content.Sound = UNNotificationSound.GetSound(soundFileName); var trigger = UNTimeIntervalNotificationTrigger.CreateTrigger(0.01, false); var request = UNNotificationRequest.FromIdentifier(messageId.ToString(), content, trigger); UNUserNotificationCenter.Current.AddNotificationRequest(request, err => { if (err != null) throw new Exception($"Failed to schedule notification: {err}"); });
What can i do to play sounds always?