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

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?



Solution 1:[1]

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 });
};

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zrelli Majdi