'When viewing the website on a phone, ask if to continue using browser or download the app to view

i want to add this feature into my project that, When a user is viewing the website on a phone, ask if to continue using browser or download the app to view. im, using angular 12 and device-detector-js

export class AppdevdetectorDirective {

constructor(
    private $bottomSheet: MatBottomSheet
) { this.$bottomSheet.open(DeviceDetectorComponent) : ''
    
    const deviceDetector = new DeviceDetector();
    const device = deviceDetector.parse(window.navigator.userAgent);
    console.log(device);
    console.log(device.client.name);
    (device.device.type === 'smartphone' || device.device.type === 'tablet' && device.client.name !== "Chrome") ? this.$bottomSheet.open(DeviceDetectorComponent) : ''

    
}

}

<router-outlet appAppdevdetector></router-outlet>

<div class="w-1/2 flex text-right content-end justify-end">
            <button onclick="window.open(document.URL, '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');" class="rounded-full bg-slate-200 py-1 w-24 flex text-base text-center justify-center items-center text-gray-700 float-right">
                Continue
            </button>
</div>


Sources

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

Source: Stack Overflow

Solution Source