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

Added exception handle that cause crashs the Apps with Capacitor when try to use .disableWebViewOptimizations #521

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cordova-plugin-background-mode",
"version": "0.7.3",
"description": "Prevent apps from going to sleep in background.",
"version": "0.7.4",
"description": "Prevent apps from going to sleep in background. Support for capacitor",
"cordova": {
"id": "cordova-plugin-background-mode",
"platforms": [
Expand Down Expand Up @@ -38,4 +38,4 @@
"url": "https://github.com/katzer/cordova-plugin-background-mode/issues"
},
"homepage": "https://github.com/katzer/cordova-plugin-background-mode#readme"
}
}
13 changes: 12 additions & 1 deletion src/android/BackgroundModeExt.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,18 @@ public void run() {
try {
Thread.sleep(1000);
getApp().runOnUiThread(() -> {
View view = webView.getEngine().getView();

View view = null;

try{

view = webView.getEngine().getView();

}catch(Exception e){

view = webView.getView();

}

try {
Class.forName("org.crosswalk.engine.XWalkCordovaView")
Expand Down