Possible to launch Apple's default weather app from my application?
Asked Answered
D

5

6

One of my client wants to open Apple's native weather app from our application. After few I don't see a possible way, unless we need to go with any 3rd party apps which provides custom url scheme.

http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899

It would be great if someone confirm or give me a lead if it is possible.

Dishman answered 18/8, 2011 at 11:57 Comment(0)
D
1

Its not possible, the weather app doesn't have a known URL scheme and I dubt that it has an unknown one.

Davenport answered 18/8, 2011 at 11:59 Comment(1)
Not true anymore with iOS 16 and macOS Ventura. See my answer below. https://mcmap.net/q/1808579/-possible-to-launch-apple-39-s-default-weather-app-from-my-applicationPoetaster
A
1

The website handleOpenURL is an excellent resource for custom iOS URL schemes; use this link to search for the known Apple app schemes.

Unfortunately the weather app is not among them.


Another couple of sites with schemes (handleOpenURL seems to be the most complete, but it can't hurt to check the others):

app lookup

Akosma iPhone URL Scheme Wiki

Anemography answered 18/8, 2011 at 12:11 Comment(1)
applookup.com seems down.Frizzly
P
1

At least with iOS 16.4 on device and in macOS Ventura you can open a URL like the following and it will act as a Universal Link and open the native Weather app showing weather close the given coordinate.

https://weather.apple.com/?lat=50.237&long=-122.022

I discovered this URL by using the Maps app on the simulator and long pressing the weather badge. This brings up a larger weather panel and if you tap that Maps.app tries to open the URL but fails on the simulator.

Poetaster answered 14/5, 2023 at 3:3 Comment(1)
Currently for that link to work on the web it seems like a city is required. Like this: weather.apple.com/…Babbitt
C
0

You can open the weather app with this URL: weather://

Here is a codepen demo I got to work: https://codepen.io/irom1/pen/KKeZBMW

<a href="weather://" target="_blank">Open weather</a>
Calculating answered 21/11, 2022 at 2:34 Comment(0)
W
0

If someone else is searching for an answer: weather://weather.apple.com/?lat=37.323&long=-122.03218 did it for me. This way you can link to a specific location.

Whilom answered 24/4, 2023 at 5:26 Comment(2)
You can use https instead of weather: on the current iOS and macOS versions as the app supports Universal Links now.Poetaster
Any idea how to open it to a search location based on a string instead of lat/long?Babbitt

© 2022 - 2024 — McMap. All rights reserved.