I have an app that I use sometimes. I must have left it there in the background before I slept. When I woke up I saw this notification on my screen.
Does anyo
You can use Notifications
to achieve this function.
From document Local notifications in Xamarin.Forms,we will find:
Local notifications are alerts sent by applications installed on a mobile device. Local notifications are often used for features such as:
- List item
- Calendar events
- Reminders
Location-based triggers Each platform handles the creation, display, and consumption of local notifications differently.
You can defines a cross-platform API that the application can use to interact with notifications.
public interface INotificationManager
{
event EventHandler NotificationReceived;
void Initialize();
int ScheduleNotification(string title, string message);
void ReceiveNotification(string title, string message);
}
For more details, you can check above document, and this link also contains a sample about Notifications.It should be helpful for you.
Of course, if you want your app send notification when app is in background, you can use background-tasks.
For more details,you can check:
https://xamarinhelp.com/xamarin-background-tasks/
https://docs.microsoft.com/zh-cn/xamarin/ios/app-fundamentals/backgrounding/
https://docs.microsoft.com/en-ie/xamarin/android/app-fundamentals/services/creating-a-service/