From b075c46ea90108a6ff1675120cbef94a6971dc01 Mon Sep 17 00:00:00 2001 From: Javier Gomez Date: Fri, 17 Jul 2020 15:56:29 -0500 Subject: [PATCH 1/7] capacitor --- src/android/BackgroundModeExt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/BackgroundModeExt.java b/src/android/BackgroundModeExt.java index ed765984..7a709bca 100644 --- a/src/android/BackgroundModeExt.java +++ b/src/android/BackgroundModeExt.java @@ -166,7 +166,7 @@ public void run() { try { Thread.sleep(1000); getApp().runOnUiThread(() -> { - View view = webView.getEngine().getView(); + View view = webView.getView(); try { Class.forName("org.crosswalk.engine.XWalkCordovaView") From 81161c6563e8be4f1cb89243f4cb099fa88b5484 Mon Sep 17 00:00:00 2001 From: Javier Gomez Date: Fri, 17 Jul 2020 15:58:09 -0500 Subject: [PATCH 2/7] capacitor --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a0c90c35..2d161491 100644 --- a/package.json +++ b/package.json @@ -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": [ From 29576adafc5a8346447c2c363f15c992d5cd7f0f Mon Sep 17 00:00:00 2001 From: Javier Gomez Date: Fri, 17 Jul 2020 16:06:13 -0500 Subject: [PATCH 3/7] capacitor support --- src/android/BackgroundModeExt.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/android/BackgroundModeExt.java b/src/android/BackgroundModeExt.java index 7a709bca..ea1ba6e2 100644 --- a/src/android/BackgroundModeExt.java +++ b/src/android/BackgroundModeExt.java @@ -166,8 +166,17 @@ public void run() { try { Thread.sleep(1000); getApp().runOnUiThread(() -> { + + try{ + + View view = webView.getInstance().getView(); + + }catch(Exception e){ + View view = webView.getView(); + } + try { Class.forName("org.crosswalk.engine.XWalkCordovaView") .getMethod("onShow") From d61138f3ae2752b41f354ec6515da961aa809844 Mon Sep 17 00:00:00 2001 From: Javier Gomez Date: Fri, 17 Jul 2020 16:11:43 -0500 Subject: [PATCH 4/7] capacitor support --- src/android/BackgroundModeExt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/BackgroundModeExt.java b/src/android/BackgroundModeExt.java index ea1ba6e2..b80cade2 100644 --- a/src/android/BackgroundModeExt.java +++ b/src/android/BackgroundModeExt.java @@ -169,7 +169,7 @@ public void run() { try{ - View view = webView.getInstance().getView(); + View view = webView.getEngine().getView(); }catch(Exception e){ From b3f5a9a47050c57e606bd1eea2f6bb8330690951 Mon Sep 17 00:00:00 2001 From: Javier Gomez Date: Fri, 17 Jul 2020 16:12:45 -0500 Subject: [PATCH 5/7] capacitor support --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2d161491..54cd3632 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-background-mode", - "version": "0.7.4", + "version": "0.7.5", "description": "Prevent apps from going to sleep in background. Support for capacitor", "cordova": { "id": "cordova-plugin-background-mode", From b1e0f02d34e85edaa3c72f8ac12299849f5a243f Mon Sep 17 00:00:00 2001 From: Javier Gomez Date: Fri, 17 Jul 2020 16:15:27 -0500 Subject: [PATCH 6/7] capacitor support --- package.json | 2 +- src/android/BackgroundModeExt.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 54cd3632..41336fd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-background-mode", - "version": "0.7.5", + "version": "0.7.6", "description": "Prevent apps from going to sleep in background. Support for capacitor", "cordova": { "id": "cordova-plugin-background-mode", diff --git a/src/android/BackgroundModeExt.java b/src/android/BackgroundModeExt.java index b80cade2..38835370 100644 --- a/src/android/BackgroundModeExt.java +++ b/src/android/BackgroundModeExt.java @@ -166,14 +166,16 @@ public void run() { try { Thread.sleep(1000); getApp().runOnUiThread(() -> { + + View view = null; try{ - View view = webView.getEngine().getView(); + view = webView.getEngine().getView(); }catch(Exception e){ - View view = webView.getView(); + view = webView.getView(); } From b7a0ed9fea789e5f40c090e8fb484cc95568abd7 Mon Sep 17 00:00:00 2001 From: Fastcode <59274026+fastcodeco@users.noreply.github.com> Date: Fri, 17 Jul 2020 19:56:14 -0500 Subject: [PATCH 7/7] Update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 41336fd9..4ffee665 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-background-mode", - "version": "0.7.6", + "version": "0.7.4", "description": "Prevent apps from going to sleep in background. Support for capacitor", "cordova": { "id": "cordova-plugin-background-mode", @@ -38,4 +38,4 @@ "url": "https://github.com/katzer/cordova-plugin-background-mode/issues" }, "homepage": "https://github.com/katzer/cordova-plugin-background-mode#readme" -} \ No newline at end of file +}