Background image with Xamarin.Forms

I am currently planning a Xamarin.Forms application, and while doing this, I came across a point that does not seem to be responding.
The application will have to work with the WCF service to get its data, and also inform the service about the performance of certain tasks. While the application is active, doing it is easy. But there is something that the application should do. Call the service every x minutes to update the data and create notifications for the user in some cases. I read something about background work in iOS or Android services, but there seems to be no way for Xamarin.Forms to have a general way to do background work. So, how can I access the WCF service and process the data while the application is inactive in Xamarin.Forms?

+5
source share
2 answers

You do this the same way you do in Xamarin, as you do in an Objective-C or Java application. You use the same API to register the background service.

There are also documents about this for iOS and for Android .

Xamarin uses the same native API for each system as any other native application. That way, everything you want to do with Xamarin can be done just as you would use original tools for vendors. The only difference is the programming language.

Xamarin.Forms is completely irrelevant here. This is an abstraction layer for native user interface interfaces that allow developers to once define a user interface and launch a truly native interface for Android, iOS, Windows Phone, and Windows Store apps. This has nothing to do with the background here.

+4
source

This is the only solution I found http://arteksoftware.com/backgrounding-with-xamarin-forms/

in a few words: you cannot abstract background tasks in Xamarin.Forms because iOS, Android, and WP work differently. You must use the MessagingCenter to send and receive data from specific implementations on each platform.

A similar thread (I copied my answer from here): Xamarin.forms runs in the background

+4
source

Source: https://habr.com/ru/post/1233846/


All Articles