Giter Site home page Giter Site logo

testweatherkitrestapi's Introduction

TestWeatherKitRESTAPI

iOS 16.2 Demo of Apple's WeatherKit REST API - This demo retrieves all weather datasets for your current location.

Note: This demo uses the Weather REST API 1.0.0+

To get started with the WeatherKit: https://developer.apple.com/weatherkit/get-started

Details on the REST API: https://developer.apple.com/documentation/weatherkitrestapi

You need an Apple Developer account.

Before you can run this demo, you will need the following from your Developer account:

  1. Team ID
  2. Service ID
  3. WeatherKit Key ID
  4. A private key (downloaded as .p8 file)

Rename SecureAPIKeys.xcconfig.sample to SecureAPIKeys.xcconfig and enter all previous information (i.e. Team ID, Service ID, etc.) in that file.

See https://developer.apple.com/documentation/weatherkitrestapi/request_authentication_for_weatherkit_rest_api for more details.

You need to install the Swift-JWT package - needed to generate a JSON Web Token (JWT) - https://github.com/Kitura/Swift-JWT

  • This demo does not use the header id to generate the JWT - even though it is part of the WetherKit REST API requirements. However, the demo still works without the id in the header (that id header cannot be used with the SwiftJWT package because SwiftJWT does not support custom headers).

If everything works correctly, you will get a screen output like the one in the image included in this project - SampleOutput.png

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.