How to link to a public url from ion-button?

Viewed 125

I want to link to a public url where my login is hosted from a button in my app. I know how to link to pages in my app but not sure how to link outside my app.

I couldn't find much when i searched for it.

Is there an ionic way to do this (which is preferred) or would i have to go the html href route?

1 Answers

Install @capacitor/browser.

npm install @capacitor/browser
npx cap sync

example function :

import { Browser } from '@capacitor/browser';
async openCapacitorSite (url:String) {
//urlFormat  http://capacitorjs.com/
  await Browser.open({ url });
};
Related