Webview Geolink Google Maps

Hello, I’m a little desperate.
I’m trying to start a webview geo link with the activity starter so that it is transferred to Google Maps and you can navigate.
I think I have an error in the block.
Perhaps one of you can help me.

the link is created with a javascript and the following function

function openGoogleMaps(address) {
        // Erstellen Sie die URLs für verschiedene Plattformen
        const googleMapsUrl = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;
        const androidUrl = `geo:0,0?q=${encodeURIComponent(address)}`;
        const iosUrl = `comgooglemaps://?q=${encodeURIComponent(address)}`;

        // Erkennen Sie die Plattform des Benutzers
        const userAgent = navigator.userAgent || navigator.vendor || window.opera;

        // Öffnen Sie den entsprechenden Link basierend auf der Plattform
        if (/android/i.test(userAgent)) {
            window.location.href = androidUrl;
        } else if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
            window.location.href = iosUrl;
        } else {
            window.open(googleMapsUrl, '_blank');
        }
    }

Nobody has an idea?