When I share sth to joplin via android sharing, joplin create a new note than go back to the previous app.
To get notes synced, anyway, it needs to open joplin app. If you forget to do so, you won't get notes synced. I'd like to add a setting to allow automatically syncing notes after sharing the note, without opening the app.
Sorry if the feature was already requested, I searched for it but not found.
Greetings, welcome to the forum,
As far as I know this feature wasn't requested as at the moment it is blocked by inability to sync in background at all (due to lack of stable background fetch library for react native itself).
As it is quite long running issue, the status is tracked on github here
opened 01:40PM - 06 Oct 20 UTC
enhancement
backlog
There are various issues ([1](https://github.com/laurent22/joplin/issues/727), [… 2](https://github.com/laurent22/joplin/issues/1029), [3](https://github.com/laurent22/joplin/issues/1501), [4](https://github.com/laurent22/joplin/issues/1645), [5](https://github.com/laurent22/joplin/issues/3671), …) and threads ([1](https://discourse.joplinapp.org/t/android-background-sync-interval/1746), [2](https://discourse.joplinapp.org/t/automatic-sync-on-phone-app/3056)) on it but it's still not clear to me what exactly is technically not possible to implement.
[This comment from September 2018 says](https://github.com/laurent22/joplin/issues/727#issuecomment-418877957):
> Cannot currently be fixed due a limitation of the underlying framework
Which might be true but that's what libraries are for, right? Therefore this is a _very_ misleading comment.
And [this comment from October 2019](https://discourse.joplinapp.org/t/automatic-sync-on-phone-app/3056/8) claims:
> we rely on existing libs, which for now don’t exist on React Native
But it doesn't mention _which_ exact libraries would be needed. The logic for syncing is obviously already there. So in theory only the support for doing exactly this sync in a background task would be needed.
And there are libraries for react-native that are doing exactly this since a few years. For example
* [`react-native-background-fetch`](https://github.com/transistorsoft/react-native-background-fetch) for Android & iOS (first version from August 2016)
* [`react-native-sync-adapter`](https://github.com/ferrannp/react-native-sync-adapter) using the Android SyncAdapter (first version from April 2017)
* [`react-native-background-task`](https://github.com/jamesisaac/react-native-background-task) again for Android & iOS (first version from February 2017)
* [`react-native-background-job`](https://github.com/vikeri/react-native-background-job) for Android (available since December 2016)
As you can see, these libraries are much older than this comment. So again this would be wrong and a false statement in case this comment refers to syncing libraries.
Also there's [this comment from June 2019](https://github.com/laurent22/joplin/issues/1645#issuecomment-500384473)
> Most likely not possible. Android phones these days have services that kill off apps that aren't used, whether you want to keep them running or not. https://dontkillmyapp.com/
Well,
1. it only affects certain vendors in an extreme way. Not every phone is affected.
2. _The exact same website_ you mentioned shows some workarounds for this very issue.
3. Apps are usually killed after a while — not immediately. So Joplin could probably still sync for a while until it would be killed.
4. Some FOSS apps which are showing notifications while they are running doesn't seem to be affected (or at least doesn't be to seem affected so often). For instance [DNS66](https://github.com/julian-klode/dns66) or [personalDNSfilter](https://github.com/IngoZenz/personaldnsfilter).
So also this comment is false / misleading since the already mentioned website also explicitly mentions workarounds.
I would obviously understand if the issue would only be the lack of people working on this. In that case this issue could be kept open for tracking, avoiding duplicates and having the possibility to show this issue for possible contributors, so that they know what's still open.
But currently the given comment are at least somehow lacking some information (or even not relevant / true).
Thus it would be great if someone could clarify what's really missing here.
**PS:** Thank you for your work!
1 Like
As sync cannot happen in the background this widget button would do exactly the same as the main button does: opening the app so it can sync.