Fetching weather forecasts with WeatherKit
Request and display weather data for destination airports in a flight-planning app.
Overview
Configure the sample code project
Before you run the sample code project in Xcode:
Download, install, and launch the latest version of Xcode.
In Safari, visit the Certificates, Identifiers, and Profiles section of the developer website.
Select Identifiers and click the Add button to create a new App ID for
FlightPlanner. Follow the steps until you reach the Register an App ID page.For the Bundle ID, select Explicit, and enter a unique bundle identifier. Use a reverse-DNS format for your identifier, as Preparing your app for distribution describes.
Click the App Services tab, and select the WeatherKit checkbox.
Complete the App ID creation process.
Wait 30 minutes while the service registers your app’s bundle ID.
In Xcode, from the Project navigator, select the
FlightPlannerproject and click the Signing & Capabilities tab.Enter the unique bundle ID from step 4 in the Bundle Identifier field of the
FlightPlannertarget.From the scheme pop-up menu, select a run destination.
If necessary, click Register Device on the Signing & Capabilities tab to create the provisioning profile.
On the toolbar, click Run, or choose Product > Run.