// // AMapNaviOpenNetwrokProxyManager.h // AMapNaviKit // // Created by chenyu on 2023/8/7. // Copyright © 2023 Amap. All rights reserved. // #import NS_ASSUME_NONNULL_BEGIN @protocol AMapNaviOpenNetwrokProxyDelegate; @interface AMapNaviOpenNetwrokProxyManager : NSObject /** * @brief AMapNaviOpenNetwrokProxyManager 单例. since 10.0.1 * AMapNaviOpenNetwrokProxyManager singleton. since 10.0.1 * @return AMapNaviOpenNetwrokProxyManager 实例 * AMapNaviOpenNetwrokProxyManager instance */ + (AMapNaviOpenNetwrokProxyManager *)sharedInstance; #pragma mark - delegate ///实现了 AMapNaviOpenNetwrokProxyDelegate 协议的类指针 ///Class pointer that implements the AMapNaviOpenNetwrokProxyDelegate protocol @property (nonatomic, weak) id delegate; @end #pragma mark - AMapNaviOpenNetwrokProxy @protocol AMapNaviOpenNetwrokProxyDelegate @optional /** * @brief 通过path获取代理host,开发者需要保证host的合法性。since 10.1.111 * Obtain the proxy host through the path, developers need to ensure the legality of the host. since 10.1.111 * @param path 网络请求的path * The path of the network request */ - (NSString *)getHostByPath:(NSString *)path header:(NSDictionary *) header; /** * @brief 开发者请根据实际情况返回对应的请求path是否需要携带参数,参数和数据放在URL中,需要注意携带的数据不易过多,且需要对key、value进行encode。since 10.1.111 * Developers should determine whether the request path needs to carry parameters based on the actual situation. Parameters and data should be placed in the URL, but note that the data should not be excessive, and the key and value need to be encoded. since 10.1.111 * @param path 网络请求的path * The path of the network request * @return 根据path返回需要携带的数据,没有需要携带的数据可返回nil,也可不实现。 * Return the data to be carried according to the path, return nil if there is no data to be carried, or it can be unimplemented. */ - (NSDictionary *)getExtRequestParamByPath:(NSString *)path header:(NSDictionary *) header; /** * @brief 通过path获取代理host。since 10.1.111 * Get the proxy host through the path. since 10.1.111 * @param path 网络请求的path * The path of the network request * @param responseStr 服务返回的数据 * The data returned by the service */ - (void)onResponseExtParam:(NSString *)path repsoneStr:(NSString *)repsoneStr requestHeader:(NSDictionary *) header; @end NS_ASSUME_NONNULL_END