I am using the MS example for showing a local notification. I am scheduling a daily repeating notification and need to modify the title and message each day based on an API call. I tried modifying the title & message that is sent to iOSNotificationManager.ReceiveNotification()
at L31 in iOSNotificationReceiver.cs, but the original title/body is always shown in the notification.
I thought maybe I could not show the original notification and create a new notification to be shown in 1 second; janky I know but it was an idea. The trouble I ran into here is that the original notification is shown even if I return at L72 in iOSNotificationManager.cs before NotificationReceived?.Invoke(null, args);
is called.
So how do I modify the title and message when just as the notification is being shown? This works perfectly fine in Android.
One thing I could do is only schedule 1 notification and when the notification is shown schedule tomorrows notification. However, if for some reason the notification was never shown one day then the next day would not be schedule therefor canceling the daily scheduled notification.
https://learn.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/local-notifications/
Modifying the data shown in a notification for iOS is impossible after the notification has been set. There is no callback method that can be used in iOS like on Android when a notification is shown.
To set the daily notification on repeat with different message the best course of action is to use push notifications. However, not having push notifications setup I set up 64 notifications, which is the max iOS allows, for the next 64 days.
Note: iOS only allows 64 notifications to be set per app.