Closed michaelconnolly1 closed 1 year ago
Yes, I have followed the instructions; as I mentioned I have tried the sample projects and I'm not getting any sounds on iOS although I do for other apps. Does the sound file have to have a specific bundle type?
@michaelconnolly1 https://github.com/dotnet/maui/issues/8612
@michaelconnolly1
Can you please try adding the sound file to iOS resources folder?
Also, make sure to Add BundleResource link in csproj
<ItemGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<BundleResource Include="Platforms\iOS\Resources\good_things_happen.aiff" Link="Resources\good_things_happen.aiff" />
</ItemGroup>
I had similar issue, and it turned out I didn't include the sound with my authorisation request ...
So, after changing it and included UNAuthorizationOptions.Sound it worked :
UNUserNotificationCenter.Current.RequestAuthorization(UNAuthorizationOptions.Alert | UNAuthorizationOptions.Sound, (approved, err) => { });
You can also check in the system settings of your application if the Notifications have Banner/Sound options and if the sound is not turned off there ...
I am not getting any sound on iOS devices, only Android. I have tried downloading various versions of the sample and ran it on 2 iPhones, an iPad and an iPad mini and none of them play any sound when the notification occurs. Any suggestions (the settings on all the devices seem fine). Devices are on iOS 14.6 with the exception of the iPad mini on 12.5.