Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Waze map for Developers ( Swift) #1

Open
Hayllander opened this issue Apr 20, 2015 · 2 comments
Open

Waze map for Developers ( Swift) #1

Hayllander opened this issue Apr 20, 2015 · 2 comments

Comments

@Hayllander
Copy link

I found the conversion of App Waze interface to Swift. So I did the conversion and am publishing for those who need it.

func viewWaze(location : CLLocation) {

    var latitude:Double = location.coordinate.latitude;
    var longitude:Double = location.coordinate.longitude;

    var link:String = "waze://"
    var url:NSURL = NSURL(string: link)!

    if UIApplication.sharedApplication().canOpenURL(url) {

        var urlStr:NSString = NSString(format: "waze://?ll=%f,%f&navigate=yes",latitude, longitude)

        UIApplication.sharedApplication().openURL(NSURL(string: urlStr)!)
        UIApplication.sharedApplication().idleTimerDisabled = true


    } else {
        link = "http://itunes.apple.com/us/app/id323229106"
        UIApplication.sharedApplication().openURL(NSURL(string: link)!)
        UIApplication.sharedApplication().idleTimerDisabled = true
    }

}

https://www.waze.com/about/dev

@AntonVolrokovioy
Copy link

Thanks for your efforts and help!!!

@sarathsarah
Copy link

What if I dont want navigation(route), only showing the destination is enough? so seting navigation = NO is ok or deleting the navigation is good?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants