L
L
LionG2021-03-28 22:01:45
Mobile development
LionG, 2021-03-28 22:01:45

How to build a mobile (ios/android) app with VueJS and a background process?

The background process is needed to update the data from the API every + -2 hours and, if necessary, show a notification to the user + auto-start when the phone is rebooted and work in the background if the application itself is closed (as I understand it, constantly running background processes are prohibited and scripts are called in the background by the system by task schedule with a timeout of 30 seconds for execution). Vue - because I know it and do not need to learn something new from 0. In general, the selection criteria are based on the background process, since it is essentially the basis of the application.

Options that I selected:
1) NativeScript-Vue + plugin nativescript-task-dispatcher
Probably the most suitable option, I get a native application at the output, nativescript is constantly evolving and it has a large library of ready-made plugins that are also supported and updated.

2) VueNative -> ReactNative + react-native-queue
vue-native did not start out of the box, which apparently indicates its dampness, and react-native-queue has not been updated for 3 years + many active Issues

3) Cordova + Vue + `background task manager` (many were updated about 5 years ago, and in the guides all their plugins are written in jav'e)
WebView dinosaur, could not find a working plugin for the background service.

Are there any other better options? Or maybe the pitfalls of these decisions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tony, 2021-03-29
@TonyHunt

https://github.com/jamesisaac/react-native-backgro...
https://github.com/transistorsoft/react-native-bac...
4) Separate "Front" from "Back".
Everything that is visual is written in Vue.
Everything that is not visually write in Kotlin.
About Android, I don't know about Mac...
Anyway, you are using Android Studio, anyway you are wrapping your applications.
Found a comment:

There is a limitation in React Native that when the app is in the background, the js bridge stops receiving messages. This means that if you're trying to send data from js, you won't be able to rely on the data that creates it. Alternatively, you can write code to send updates in native code and that should help.

As a conclusion, you still have to cut on Kotlin / Swift. On Kotlin, you can cut under Mac.

V
Viktimius, 2021-03-30
@Viktimius

You can use quasar, vue under the hood, android-studio and java sdk(corona, cordova). In cordova-plugins, it seems that you can chain task runner + have access to the device. As for the pitfalls, I won’t tell you, well, as they wrote above, these are wrappers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question