Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70910

Capacitor 3: Run livereload with with ssl

$
0
0

I need to run the capacitor live reload with ssl, because the library auth0-spa needs to be executed on a secure origin. So I use this command to run livereload:

ionic cap run -l --external --ssl

To make this work, I need to add the code from user Badisi in this github issue to MainActivity.java. Otherwise, the self signed certificate is not accepted.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
        // Additional plugins you've installed go here
        // Ex: add(TotallyAwesomePlugin.class);
    }});

    if (BuildConfig.DEBUG) {
        this.bridge.getWebView().setWebViewClient(new BridgeWebViewClient(this.bridge) {
            @Override
            public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) {
                handler.proceed();
            }
        });
    }
}

This works, but it skips Capacitor 3 plugin auto detection.

How can I modify this code to have working Capacitor 3 plugin auto detection?
Do you plan to implement support for --ssl flag in livereload mode? Would be great. In some cases, it is needed.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70910

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>