Weather Warning
For iOS SDK v4.9+Weather Warning for getting real-time local severe weather warning around the world, including typhoon, heat wave, cold wave, gale, heavy air pollution, wildfire, dust storms, droughts, lightning, hail, frost, heavy fog, etc.
See also Warning Info.
Weather Warning
Interface code (Enum) | Interface | Class |
---|---|---|
INQUIRE_TYPE_WARNING | Weather warning | WarningBaseClass |
Request Parameters
If no optional parameters are set, the default value will be used.
location
The city to be queried, support LocationID or comma-separated longitude and latitude (decimal, up to 2 decimal places), LocationID can be obtained by GeoAPI.
Weather warnings are not available in all cities, see supported countries or regions for weather warnings.
appKey
API authentication key, please refer to How To Get Your Key.
For example: appKey=12334567890ABC
lang
Multi-language setting, default Chinese, only support Chinese and English for this data. Language parameter please refer to Language
Sample Code
QWeatherConfigInstance.publicID = @"publicID";
QWeatherConfigInstance.appKey = @"key";
QWeatherConfigInstance.appType = APP_TYPE_BIZ;
QWeatherConfigInstance.location = @"101010100";
QWeatherConfigInstance.lang = @"";
QWeatherConfigInstance.unit = @"";
[QWeatherConfigInstance weatherWithInquireType: INQUIRE_TYPE_WARNING WithSuccess:^(WarningBaseClass *responseObject) {
NSLog(@"Description->%@",[responseObject description]);
} faileureForError:^(NSError *error) {
NSLog(@"error->%@",error);
}];
Response
Parameters | Description |
---|---|
code |
API status code, please refer to Status Code |
updateTime |
|
fxLink |
Responsive web page of this data, for embedded in website or APP |
warning.id |
The unique ID of this warning, which can be used to determine whether this warning already exists. |
warning.sender |
Warning issuing unit, may be null |
warning.pubTime |
Warning release time |
warning.title |
Title of warning |
warning.startTime |
Warning start time, may be null |
warning.endTime |
End time of warning, may be null |
warning.status |
|
warning.level |
Warning level(deprecated), this field is deprecated and uses |
warning.severity |
|
warning.severityColor |
Preferred color for severity, may be null |
warning.type |
|
warning.typeName |
|
warning.urgency |
The urgency of the warning message, may be null |
warning.certainty |
The certainty of the warning message, may be null |
warning.text |
Description of the warning |
warning.related |
The warning ID associated with this warning, returned when the warning status is |
refer.sources |
Data source and other statements, may be null |
refer.license |
Data license, may be null |
Weather Warning City List
Get a list of cities for the specified country or region where weather warnings are currently in effect.
Interface code (Enum) | Interface | Class |
---|---|---|
INQUIRE_TYPE_WARNINGLIST | List of warning cities | WarningListClass |
Request Parameters
If no optional parameters are set, the default value will be used.
range
Set country or region. See supported countries or regions for Weather Warning, ISO 3166 format.
For example range=cn
, range=fr
appKey
API authentication key, please refer to How To Get Your Key.
For example: appKey=12334567890ABC
Sample Code
QWeatherConfigInstance.publicID = @"publicID";
QWeatherConfigInstance.appKey = @"key";
QWeatherConfigInstance.appType = APP_TYPE_BIZ;
QWeatherConfigInstance.range = @"cn";
[QWeatherConfigInstance weatherWithInquireType: INQUIRE_TYPE_WARNINGLIST WithSuccess:^(WarningListClass *responseObject) {
NSLog(@"Description->%@",[responseObject description]);
} faileureForError:^(NSError *error) {
NSLog(@"error->%@",error);
}];
Response
Parameters | Description |
---|---|
code |
API status code, please refer to Status Code |
updateTime |
|
warningLocList.locationId |
List of Location ID for warning |
refer.sources |
Data source and other statements, may be null |
refer.license |
Data license, may be null |