forked from katzer/cordova-plugin-background-mode
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4604957
commit 6582046
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6582046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
@brunochikuji , why
FOREGROUND_SERVICE_TYPE_DATA_SYNC
and notFOREGROUND_SERVICE_TYPE_LOCATION
?Thanks :)
6582046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lmarcelocc , it was actually an implementation made following a suggestion from another client who was using the lib.
FOREGROUND_SERVICE_TYPE_LOCATION makes sense and I'll test it by changing it
6582046
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @brunochikuji ,
If I changed to
FOREGROUND_SERVICE_TYPE_LOCATION
I'm having this issue testing on Android 14. It happens only when user did not granted permissions andcordova-plugin-background-mode
callskeepAwake() -> startForeground()
. If user has alredy granted permissions, it works. So it seems we need to guarantee that we've all the permissions before calling thekeepAwake()
method.My first though was to subscribe to those permissions and only call
keepAwake()
when granted.My knowledge here is limited, but will keep this post update with my findings.