I have UWP app service with TimeTrigger. Every time this trigger fires i'm trying to download some data from the internet.
Is there anyway my service can notify my second UWP UI app about data load success|fail? The only way i've found is to run the second service in UI app thread and call it to send the notification.
The original task is to create an always-running data update checking service and load a data consuming UWP UI app that may or may not be running.
Related
Im working on the app sends list of data to server one by one in foreground with progress indication via push notification to user. I need to send the data to server even the app is killed with the progress indication using the android service.
Is this possible? If not please suggest me any other solutions or techniques.
Actually I was trying to implement background process (fetch data from api) even the app is terminated in my flutter project how can I achieve in both Android & iOS platforms.
Have you ever wanted to execute Dart code in the background—even if your app wasn’t the currently active app?
The mechanism for this feature involves setting up an isolate.
Isolates are Dart’s model for multithreading, though an isolate
differs from a conventional thread in that it doesn’t share memory
with the main program. You’ll set up your isolate for background
execution using callbacks and a callback dispatcher.
Example
but if you want do that when app terminated, you will have to wakeup app through Workmanager or some another approach like sending firebase push notification or wakeup app in scheduled time with flutter alarm manager or something like that
I have searched Google, YouTube and stack overflow for the answer but I haven't found any real solution.
I want to implement my own push notification solution on flutter, without firebase nor One signal. I do not want to depend on a third party service.
My Backend is on GoLang with graphql.
On the frontend, I am using a block pattern (flutter_bloc v6) and graphql_flutter v4.
I am using graphql subscriptions, so whenever the Backend emits a signal, the flutter app is able to receive it immediately.
I would like to be able to push up notifications to my users whenever the Backend sends some information, no matter if the app is on the foreground, background, closed or whatever. I do not want scheduled notifications either (aka flutter_local_notifications)
Do you want to use a third service other than firebase/one signal?
Then you can try airship(https://docs.airship.com/reference/messages/message-types/push-notifications/)
But if you want to setup your own provider server, please check this page(https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server), this is the start point, from where you can start your investigation and development.
Then you have to create your own backend system to send push notifications to the device. You have to develop Native Application for iOS and Android going beyond flutter. The local push notification could be used but you need to develop a custom notification receiver that will respond to the notification call back from the server in the background.
I am writing a UWP app that expect to have updated data from a remote, say a cloud service or a remote station or whatever.
So, I thought an obvious solution would be to write a service that will sync data periodically and UWP app will just show it. I started reading about it and ended up reading this MSDN article about Windows 10 AppService
https://learn.microsoft.com/en-us/windows/uwp/launch-resume/how-to-create-and-consume-an-app-service
But after reading the article, I stumble upon this portion as per screenshot below which basically tells that if my app is back-grounded (minimized or covered by another app), then the service will continue running for up to 30 seconds and then stop running. This means after 30 seconds, my background syncing will stop:
How can I make sure that my data is being refreshed when needed even though my app is not in the foreground?
Your background task can only run for 30 seconds for processing information but you can make it so your background task runs ever 15 minutes to check if new information is available using a Time Trigger.
If you want your application to check more frequently you will have to use a Toast Notification that comes from a server, such as Azure Mobile App Service, AWS Simple Notification Service, etc. or you can create your own service using the WNS(windows notification service).
Azure
https://azure.microsoft.com/en-us/services/app-service/mobile/
AWS
https://aws.amazon.com/sns/
I have an iPhone application like facebook for iPhone. My application must connect my server and read all message every two hours regularly. I have a thread to read all message but when the application is terminated the thread cannot work. Can the thread run undependently from main delegate or how can I find solution for this problem?
You cannot have your app do stuff in the background. There is an API to finish tasks like uploading a photo but even that will be killed after around 10 minutes.
But the Apple Push Notification Service seems like the most appropriate solution for your problem. Your server notifies the device that there is something new happening and you fetch the actual messages when the user opens the app.
edit: As of iOS 7 Apple implemented a feature where you can schedule running tasks to fetch data in the background. Those tasks are not guaranteed to run at any specific times. See the release notes for iOS 7 and the linked methods below:
Apps that regularly update their content by contacting a server can
register with the system and be launched periodically to retrieve that
content in the background. To register, include the UIBackgroundModes
key with the fetch value in your app’s Info.plist file. Then, when
your app is launched, call the setMinimumBackgroundFetchInterval:
method to determine how often it receives update messages. Finally,
you must also implement the
application:performFetchWithCompletionHandler: method in your app
delegate.
There is no solution.
Apple does not permit applications to run in the background unless they are of a specific type such as location or audio or voip or newstand (your app can continue to run for about 10 minutes after it was active if it uses shouldBeginBackgroundTaskWithExpirationHandler).
There is no workaround, many many other people have wondered how to do the same thing as yourself before, but there is no legitimate way. Your app cannot schedule any sort of periodic call home activity.
The only way your app can run once its gone into a suspended or terminated state is for the user to launch it, either explicitly or in reponse to a local notification or remote push notification.