Weather Warning

For iOS SDK v4.8+

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.

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

API last update time

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 status, may be null
active Early warning or first warning
update Warning information update
cancel cancel warning

warning.level

Warning level

warning.type

Warning type ID

warning.typeName

Warning type name

warning.text

Description of the warning

warning.related

The warning ID associated with this warning, returned when the warning status is cancel or update. May be null

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

API last update time

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

Warning Level and Type

See Warning Level and Type