weather_kit 0.1.0 copy "weather_kit: ^0.1.0" to clipboard
weather_kit: ^0.1.0 copied to clipboard

outdated

A dart library for interfacing with the Apple WeatherKit API.

Weather Kit #

Prerequisite #

Apple Developer Program #

You must be a member of the Apple Developer Program to use this package.

Bundle ID #

You can register and check bundle id from Xcode or Certificates, Identifiers & Profiles.

Team ID #

You can check Team ID from Membership.

keyID and p8 certificate for Weather Kit #

In order to use the Weather Kit,

  1. Access to Certificates, Identifiers & Profiles / Keys
  2. Enter any Key Name in the form and check the Weather Kit checkbox.
  3. Tap "register" and you can check Key Id
  4. Tap "Download" to get p8 certificate.

Examples #

Here are small examples that show you how to use the API.

Generate JWT

final weatherKit = WeatherKit();
final token = weatherKit.generateJWT(
  bundleId: 'com.example',
  teamId: 'team id',
  keyId: 'key id',
  pem: 'example.p8',
  expiresIn: const Duration(hours: 1),
);

Obtain current weather

final result = await weatherKit.obtainWeatherData(
  jwt: token,
  language: 'ja',
  latitude: '35.71',
  longitude: '139.811',
  dataSets: 'currentWeather',
);

References #

15
likes
0
pub points
57%
popularity

Publisher

verified publishermafreud.dev

A dart library for interfacing with the Apple WeatherKit API.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dart_jsonwebtoken, flutter, http

More

Packages that depend on weather_kit