Notification is not work in IOS
See original GitHub issueDescribe the bug I’m trying to get local notifications on the iOS platform, but nothing appears, it works fine on Android, but in iOS nothing appears,I am using an iPhone iOS 16 emulator
To Reproduce 01 - MauiProgram.cs
.UseLocalNotification(config =>
{
config.AddiOS(iOS =>
{
iOS.SetPermission(new iOSNotificationPermission
{
LocationAuthorization = iOSLocationAuthorization.WhenInUse
});
});
})
02 - add permission to Info.plist
Privacy - Location When In Use Usage Description
03 - Schedule Notification
if (marktingsAdList.Count() > 0)
{
var ScheduleTime = DateTime.Now;
var NotifiId = 0;
foreach (var item in marktingsAdList)
{
ScheduleTime = ScheduleTime.AddSeconds(1);
NotifiId++;
var notify = new NotificationRequest
{
BadgeNumber = NotifiId,
NotificationId = NotifiId,
Subtitle = "الجميع أونلاين ",
Title = item.Title,
Description = item.Kind,
CategoryType = NotificationCategoryType.Service,
Schedule = new NotificationRequestSchedule
{
NotifyTime = ScheduleTime,
},
Android = new Plugin.LocalNotification.AndroidOption.AndroidOptions
{
IsProgressBarIndeterminate = true,
VisibilityType = Plugin.LocalNotification.AndroidOption.AndroidVisibilityType.Private,
LedColor = 1,
}
};
LocalNotificationCenter.Current.Show(notify);
}
}
Expected behavior A notification is expected to appear in the emulator system, but nothing appears !!
Platform (please complete the following information):
- OS: iOS
- Version 16.1
Smartphone (please complete the following information):
- Device: iPhone 14 Simulator
- OS: iOS16.1
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Notifications on my iPhone are not working
Notifications on my iPhone are not working. No longer receive notifications on apps that I set up to receive them except iMessage and...
Read more >How to Fix Notifications Not Working on iPhone and iPad
You can go to Settings > Focus > Do Not Disturb to turn it off and check whether you can receive notifications again....
Read more >Notifications not working in iOS 16? 9 Ways to fix it!
Notifications not working in iOS 16? 9 Ways to fix it! · 1. Turn off Focus on iPhone · 2. Add exceptions to...
Read more >How To Fix Not Getting Notifications on an iPhone
Method No. 1 – Restart Your iPhone Method No. 2 – Check Your Notification Settings Method No. 3 – Disable Focus Mode Method...
Read more >iPhone Notifications Not Working: 5 Ways to Fix It
Make sure notifications are turned on · 1. Open the Settings app. · 2. Tap Notifications. · 3. Tap on Show Previews at...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ZacharyThomasStone , remember that you have 2 instances for the messages to show:
Foreground - Application is running and open - iOS will not show the message when you in this mode, you must handle the incoming message based on the
+= NotificationReceived
eventhandler from the DI instance. eg: push an Alert popup on the MainThread to display the message.Background - this is when you minimized or closed the app, now for debugging, I’ve used just the minimize, the OnSleep in App.cs is called and VS still runs in debug mode. Push the message request with your schedule set to 30seconds from the .Show() method, sleep the device, and wait for it to appear.
I’ve tested with just the default
.UseLocalNotification()
in MauiProgram.cs running .net-6.0. Hope this helps.@Kremed @gsk143 @danlfarnell @ZacharyThomasStone @EntityBox
Please try version 10.1.6