Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 9 don't work #493

Open
Electrobyte2 opened this issue Jan 9, 2020 · 13 comments
Open

Android 9 don't work #493

Electrobyte2 opened this issue Jan 9, 2020 · 13 comments

Comments

@Electrobyte2
Copy link

Electrobyte2 commented Jan 9, 2020

HI! i' have a phonegap application and for android-targetSdkVersion 27 works well.
For android-targetSdkVersion 28 crash with background plugin. I put permissions in my config.xlm and dosen't work. Any someone have a solution?

config.xlm Head:
`

 <platform name="android">
         <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
             <application android:usesCleartextTraffic="true" />

         </edit-config>


 </platform>

 <platform name="android">
         <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
             <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

         </edit-config>


 </platform>`
@mooner1022
Copy link

This plugin doesn't update anymore. https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/ this fork works on android 9.

@ThorvaldAagaard
Copy link

What is the change compared to this version?

@JohannesPertl
Copy link

@ThorvaldAagaard
Copy link

On both IOS and Android?
I have been testing a lot, and it seems that on Android it works for some time 5+ hours and then it suddenly stops for no apparent reason

@JohannesPertl
Copy link

Only on Android, I only use it for a simple timer app and didn't test it for more than a few minutes

@ThorvaldAagaard
Copy link

Could be interesting if you could test it running 24 hours

@danielehrhardt
Copy link

I think it is also related to what device you are using.
https://dontkillmyapp.com/

@JohannesPertl
Copy link

I tried running it for 24 hours, it crashed after about 6. I'm using a Huawei phone, so that might be the reason

@ThorvaldAagaard
Copy link

It seems to be webview that is the problem. I have had an android native application running in the background for 3+ days now. But when starting the backgroundservice from a webview I ndver have seen it running more than 6-8 hours

@danielehrhardt
Copy link

It seems to be webview that is the problem. I have had an android native application running in the background for 3+ days now. But when starting the backgroundservice from a webview I ndver have seen it running more than 6-8 hours

So the Plugin is Buggy.

@Electrobyte2
Copy link
Author

This plugin doesn't update anymore. https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/ this fork works on android 9.

Ok but this new plugin are compatible whith phonegap?

@ThorvaldAagaard
Copy link

I am using the plugin https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/ and it has the same problems. It is working fine for some hours, then it stops

@noriellecruz
Copy link

noriellecruz commented Apr 8, 2020

@JohannesPertl @ThorvaldAagaard it should work properly if this was used in your tests:

cordova.plugins.backgroundMode.on('activate', function() {
   cordova.plugins.backgroundMode.disableWebViewOptimizations(); 
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants