dsungaro
dsungaro

Reputation: 158

Xamarin.Android: show notification when app is not running

I plan to extend my Xamarin.Android app (runs only on Android 9 devices) to periodically check a web service for new info and if there's new info, show a notification to the user.

How can I implement this if the polling and the notification shall also happen when the app is not running, e.g. when the device has just started?

Are IntentService and AlarmManager the right places to dig into?

Upvotes: 1

Views: 961

Answers (1)

Devesh
Devesh

Reputation: 4560

Rather than writing a service in the background which may be killed by the android or having issue with the network reliability and complicated retry logic. It is far better to use the FCM push notification from the server to the devices and show them the information what you want to show.

For more you can check this https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/notifications/

Upvotes: 1

Related Questions