simonmaddox / GoogleTransit-iOS6

Use Google Maps for Mobile's Transit Directions in iOS6's Maps.app
301 stars 28 forks source link

Fixed bug where the map URL wouldn't be launched the first time #4

Closed jonathanpenn closed 12 years ago

jonathanpenn commented 12 years ago

The application:openURL:sourceApplication:annotation message is sent to an app that is already running. If the app is launched with a url, then the url will be in the launchOptions dictionary passed in to application:didFinishLaunchingWithOptions: and the openURL message is not sent to the app delegate for that url.

This patch fixes that by checking for the launch url and passing it through to the openURL message. I needed to wait for 0.3 seconds for the system to "settle down" after launch before triggering the url, otherwise, nothing would happen.

simonmaddox commented 12 years ago

Well spotted! Thanks.

jonathanpenn commented 12 years ago

No prob! Great work on this.