localnotificationsplugin
localnotificationsplugin copied to clipboard
No sound when notification is received in iOS
No sound when notification is received in iOS(((
@Nikdm46 you can set that in your appdelegate.
@ravinderjangra, But how?
UNUserNotificationCenter.Current.RequestAuthorization( UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound, (approved, error) => { }); But no sound!!!!!
if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
{
var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(
UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound,
new NSSet());
UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
UIApplication.SharedApplication.RegisterForRemoteNotifications();
}
else
{
UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);
}
@jamesmontemagno, still no sound((
somebody help me!!!!!!
it looks as though there was no sound in the plug-in at the same time. And alerts are created without a sound
@Nikdm46 are you running on iOS 10+? If so, did you also add sound to the alert options in your UNUserNotificationCenterDelegate
? If you app is active, this delegate is how you specify what the notifications should do - take a look at the README and the sample.
@edsnider,
public override void WillPresentNotification(UNUserNotificationCenter center, UNNotification notification, Action<UNNotificationPresentationOptions> completionHandler)
{
// Tell system to display the notification anyway or use
// None
to say we have handled the display locally.
completionHandler(UNNotificationPresentationOptions.Alert | UNNotificationPresentationOptions.Sound);
}
It did not help!(
No sound, if app is not active too!
Hi @edsnider, @Nikdm46 I've replicated the issue on my iOS 10+ device, I think the iOS implementation is missing the Sound property for notifications - see line 100 here:
https://github.com/edsnider/LocalNotificationsPlugin/blob/master/src/Plugin.LocalNotifications.iOS/LocalNotificationsImplementation.cs
as much as I can tell, even if the developer configured completionHandler with UNNotificationPresentationOptions.Sound they won't hear anything - because the sound isn't set!
Luckily for us lorenzogiudici5 has made a Pull Request that seems to address this issue.
https://github.com/edsnider/Xamarin.Plugins/pull/33/files
so if @edsnider can test and approve that PR maybe things would move forward. From personal experience notification without sound isn't that useful, so I can't use this package until this issue is resolved!
@edsnider I am also in the waiting list to to approve @ lorenzogiudici5 pull request. I think its pretty amazing that he solved sound and vibration problem.
I am eagerly waiting as well.
@oliver-eastpoint , the pull request you pointed out looks like it's for the old repo, so I'm not sure how easy it would be to pull it into the new repo?
I noticed there is another pull request for the current repo, which also looks like it addresses the sound issue, though I don't know if it addresses vibration as well. It's pull request #17
I'd be happy with either, though the vibration working too seems important.
@edsnider , does either of those look OK to you?
Also, with the latest version, I've tried Android, and am not hearing any sound there either. Does this issue affect Android as well?
@edsnider, can you please add sound and vibration feature to your plugin?
Thanks in advance.
@edsnider how about now?