iOS doesn't open Plans/Maps from link

Hey guys,

I’m building an Ionic 3 app and I have an issue with a maps link on iOS.
I have a button and a geolocation associated to it. When I click on it, the app should open Plans, Maps or Waze and get me to the geolocation I want.
Things is, it’s working perfectly on Android, but nothing happens on iOS…

I don’t know what to do.

Here is my button:

 <a [href]="getRestoGeo()" title="Itinéraire"><button ion-button class="btn-menu">M'y rendre</button></a>

And here is my getRestoGeo() function:

getRestoGeo(): SafeUrl {
    let url = "geo:";
    if(this.platform.is('ios')) {
        url = "maps://";
    }
    return this.sanitizer.bypassSecurityTrustUrl(url + this.resto.latitude + ", " + this.resto.longitude + "?q=" + this.resto.name + " " + this.resto.address + " " + this.resto.zipCode + " " + this.resto.city);
}

I’ve tried with many ways, like “maps://?q=LAT+LNG” etc… Nothing happens, no errors… Still working on Android.

Thanks for your help guys !

Hello,

are you sure that your string for bypassSecurityTrustUrl is correct? Maybe it helps to build the string to mystring variable and log it, maybe then it easier to see what is the difference to mystring, what sanitizer outputs and what is expected.

Best regrads, anna-liebt

Hi @anna_liebt, thanks for helping me :slight_smile:

I’m not English so forgive me if I misunderstood what you said, but here’s what I logged.
The first one is the string, the second one is the string sanitized:
34

Anyone knows how to do it ? I want to click on a button which opens Plans/Maps/Waze and bring me where I want.

Thanks !