You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.4 KiB

3 years ago
//
// BMKLocationAuth.h
// LocationComponent
//
// Created by baidu on 2017/4/10.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocationAuth_h
#define BMKLocationAuth_h
///定位鉴权错误码
typedef NS_ENUM(NSInteger, BMKLocationAuthErrorCode) {
BMKLocationAuthErrorUnknown = -1, ///< 未知错误
BMKLocationAuthErrorSuccess = 0, ///< 鉴权成功
BMKLocationAuthErrorNetworkFailed = 1, ///< 因网络鉴权失败
BMKLocationAuthErrorFailed = 2, ///< KEY非法鉴权失败
};
///通知Delegate
@protocol BMKLocationAuthDelegate <NSObject>
@optional
/**
*@brief
*@param iError : 0BMKLocationAuthErrorCode
*/
- (void)onCheckPermissionState:(BMKLocationAuthErrorCode)iError;
@end
///BMKLocationAuth类。用于鉴权
@interface BMKLocationAuth : NSObject
///鉴权状态0:成功; 1:网络错误; 2:授权失败
@property(nonatomic, readonly, assign) BMKLocationAuthErrorCode permisionState;
/**
* @brief BMKLocationAuth的单例
*/
+ (BMKLocationAuth*)sharedInstance;
/**
*@brief
*@param key key
*@param delegate
*/
-(void)checkPermisionWithKey:(NSString*)key authDelegate:(id<BMKLocationAuthDelegate>)delegate;
@end
#endif /* BMKLocationAuth_h */