@Capacitor/App-launcher opens webpage instead of app

207 views Asked by At

I have installed @capacitor/app-launcher in my ionic cordova project as @ionic-native/app-launcher is no longer usable after upgrading the angular version to 16.

I tested the plugin by trying to open basic apps on my emulator. Instead of launching the app, the plugin opens the package name through a webpage.

Here's the code I tested.

import {AppLauncher} from '@capacitor/app-launcher';

const packageName = 'com.android.calendar';
const {value} = await AppLauncher.canOpenUrl({url: packageName});
if (value) {
    AppLauncher.openUrl({url: packageName})
}

I also tested youtube, clock and other basic apps in my emulator. Instead of launching the app, it opens a webpage with the link http://localhost/com.android.calendar. I've read capacitor's documentation and followed youtube guides but my result doesn't seem to be the same. Any ideas on why this is happening?

0

There are 0 answers