iOS Question Open URL

Humberto

Active Member
Licensed User
Longtime User
I´m trying to open an URL in a map.googl

I Setup in Main

B4X:
    #QueriesSchemes: https, http
      #UrlScheme: https, http

And the code is
B4X:
 Log ( "URL: " & s )
     If app.CanOpenUrl(s) Then
        app.OpenUrl(s)
    End If

and the log is

B4X:
URL: https://maps.google.com/maps/api/staticmap?center=-23.55402,-46.69111&markers=color:red|label:you|-23.55402,-46.69111&zoom=16&size=800x680
-canOpenURL: failed for URL: "(null)" - error: "Invalid input URL"

It says that the URL is "NULL"

Now works ( ** edit at 17:38

I use
http://maps.google.com/maps?q=loc:" & xLat & "," & xLong

How to do with Waze ?

I´m trying like in B4a

waze://?ll=-23.5578,-46.68981&navigate=yes
 
Last edited:

Humberto

Active Member
Licensed User
Longtime User
I define "#QueriesSchemes: waze" in a separete line and the code to verify is
B4X:
If app.CanOpenUrl("waze://") Then


If I call with the url typed directly works.

B4X:
app.OpenUrl("waze://?ll=37.331689,-122.030731&navigate=yes")

If the parameters is a string do nothing

B4X:
app.OpenUrl(s )

Where "s" is equal the url
 
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
Someone

This works
B4X:
app.OpenUrl("waze://?ll=37.331689,-122.030731&navigate=yes")

And this doesn´t work

B4X:
url = "waze://?ll=37.331689,-122.030731&navigate=yes"
app.OpenUrl(url)
 
Upvote 0

Humberto

Active Member
Licensed User
Longtime User
I found

the URL variable had a space at the end after "yes" and because of that the waze doesn´t fire
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…