JohannesBauer97 / keycloak-ionic

Keycloak Capacitor Adapter for Ionicframework
https://www.npmjs.com/package/keycloak-ionic
Apache License 2.0
16 stars 19 forks source link

cordova-plugin-browsertab is no longer maintained #12

Open dlebee opened 3 years ago

dlebee commented 3 years ago

Hello,

it seems cordova-plugin-browsertab is no longer maintained according to

https://github.com/google/cordova-plugin-browsertab/issues/39

They propose to use a different plugin in the issue

https://github.com/TobyEb/cordova-plugin-colored-browser-tabs


On android capacitor build it creates this issue

/Users/davidlebee/Dev/Thygeson/thygeson-app/android/capacitor-cordova-android-plugins/src/main/java/com/google/cordova/plugin/BrowserTab.java:21: error: cannot find symbol
import android.support.customtabs.CustomTabsIntent;
                                 ^
  symbol:   class CustomTabsIntent
  location: package android.support.customtabs
CarlosDez23 commented 3 years ago

Hey @dlebee could u fix your issue?

dlebee commented 3 years ago

@CarlosDez23 Hi carlos the issue is still there, but there is a way if you are using Capacitor 3 to specify the plugins you want to include for a specific platform.

{
  "appId": "com.lebee.thygeson",
  "appName": "thygeson",
  "webDir": "www",
  "bundledWebRuntime": false,
  "android": {
    "includePlugins": [
      "@capacitor/app",
      "@capacitor/haptics",
      "@capacitor/keyboard",
      "@capacitor/status-bar",
      "ionic-plugin-deeplinks"
    ]
  }
}

this allows me to exclude the plugin cordova-plugin-browsertab from android and successfully build.

CarlosDez23 commented 3 years ago

Thanks mate! If you are still in problems (is my case) with keycloak auth, I will be testing this package (a basic openid client for angular): https://github.com/damienbod/angular-auth-oidc-client

Nivani commented 2 years ago

What worked for me is to use patch-package to update import android.support.customtabs.CustomTabsIntent; to import androidx.browser.customtabs.CustomTabsIntent in https://github.com/google/cordova-plugin-browsertab/blob/master/plugin/src/android/BrowserTab.java

This is the patch file: cordova-plugin-browsertab+0.2.0.patch

diff --git a/node_modules/cordova-plugin-browsertab/src/android/BrowserTab.java b/node_modules/cordova-plugin-browsertab/src/android/BrowserTab.java
index 5f8e56a..0aeda0a 100644
--- a/node_modules/cordova-plugin-browsertab/src/android/BrowserTab.java
+++ b/node_modules/cordova-plugin-browsertab/src/android/BrowserTab.java
@@ -18,7 +18,7 @@ import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
 import android.net.Uri;
-import android.support.customtabs.CustomTabsIntent;
+import androidx.browser.customtabs.CustomTabsIntent;
 import android.util.Log;

 import java.util.Iterator;

I've seen other people with similar problems with react-native suggest using jetifier, but did not try it myself.

athyla commented 2 years ago

I have tried Jetifier recently, although being deprecated, it still makes cordova-plugin-browsertab usable.