1

Here's what works well on android

/// this will schedule the startup from the background
Intent intent = new Intent(Android.App.Application.Context, typeof(AlarmHandler));
PendingIntent pendingIntent = PendingIntent.GetBroadcast(Android.App.Application.Context, pendingIntentIdMain++, intent, PendingIntentFlags.CancelCurrent);
AlarmManager alarmManager = Android.App.Application.Context.GetSystemService(Context.AlarmService) as AlarmManager;
alarmManager.Set(AlarmType.ElapsedRealtimeWakeup, SystemClock.ElapsedRealtime() + 60 * 1000, pendingIntent);
/////

Is there anything similar to iOS?

Or do I need to enable background mode in info.plist? (then help me decide which one to include)(I think no option suits me.)

Task logic (tasks that need to be called at least once an hour):

  1. find out the local time of the user
  2. search for an approximate match in the local user database.
  3. if a match is found, show the user a local notification.
alexandr f
  • 183
  • 16
  • google `xamarin ios background task` to find docs. OR to see similar questions already asked at SO, google `xamarin ios background task site stackoverflow.com`. There are many such questions already. – ToolmakerSteve Nov 04 '21 at 00:40
  • Does this answer your question? [How to perform a simple background task on Xamarin iOS](https://stackoverflow.com/questions/58325614/how-to-perform-a-simple-background-task-on-xamarin-ios) – ToolmakerSteve Nov 04 '21 at 00:42

0 Answers0