//
//  ATInitManager.h
//  Pods-Runner
//
//  Created by GUO PENG on 2021/6/26.
//

#import <Foundation/Foundation.h>
#import <AnyThinkSDK/AnyThinkSDK.h>

NS_ASSUME_NONNULL_BEGIN

typedef void (^RequestErrorBlock)(NSError*);

@interface ATInitManager : NSObject


/// Log switch, on by default
+ (void)setLogEnabled:(BOOL)logEnabled;

/// Set channel
+ (void)setChannelStr:(NSString *)channelStr;

/// Set sub-channel
+ (void)setSubchannelStr:(NSString *)subchannelStr;

/// Set custom rules
+ (void)setCustomDataDic:(NSDictionary *)customDataDic;

/// Set cross-promotion excluded app ID list
+ (void)setExludeAppleIdArray:(NSArray *)exludeAppleIdArray;

/// Set placement ID rules
+ (void)setPlacementCustomData:(NSDictionary *)customDataDic placementIDStr:(NSString *)placementIDStr;

/// Get GDPR level
+ (NSString *)getGDPRLevel;

/// Get user location
+ (void)getUserLocation;

/// Show GDPR consent UI
+ (void)showGDPRAuth;

/// Display GDPR+UMP authorization interface (compatible with old calls without appId)
+ (void)showGDPRConsentDialog;
+ (void)showGDPRConsentDialogWithAppId:(nullable NSString *)appId;

/// Display GDPR+UMP secondary confirmation interface (appId can be empty, compatible without appId)
+ (void)showGDPRConsentSecondDialogWithAppId:(nullable NSString *)appId;

/// Check whether it is EU traffic (appId can be null, the asynchronous callback returns the result)
+ (void)checkIsEuTrafficWithAppId:(nullable NSString *)appId completion:(void (^)(BOOL isEuTraffic))completion;

/// Set GDPR level
+ (void)setDataConsentSet:(NSString *)gdprLevel;

/// Restrict these privacy data uploads
+ (void)setDeniedUploadInfoArray:(NSArray *)infoArray;

/// Set advertising source privacy compliance policy
+ (void)setAdSourcePrivacyPolicy:(nullable NSString *)policyJson;

/// Register waterfall filter (filterJson root key groups; within-group AND, between-group OR;)
+ (void)putFilter:(nullable NSString *)placementId filterJson:(nullable NSString *)filterJson;

/// Remove the filter for the specified ad slot
+ (void)removeFilterWithPlacementId:(nullable NSString *)placementId;

/// Remove all filters
+ (void)removeFilters;

/// Initialize SDK
+ (void)initAnyThinkSDKAppID:(NSString *)appIdStr appKeyStr:(NSString *)appKeyStr requestError:(RequestErrorBlock) requestErrorBlock;

/// Set preset strategy path
+ (void)setPresetPlacementConfigPath:(NSString *)pathStr;

/// Set shared placement config
+ (void)setSharedPlacementConfig:(NSDictionary *)configDict;

/// Show debug UI
+ (void)showDebuggerUI:(NSString *)debugKey;

/// Get SDK version
+ (NSString*)getSDKVersionName;

/// Integration check (= ATAPI integrationChecking)
+ (void)integrationChecking;

/// Personalized ads (RN: 0=PERSONALIZED, 1=NONPERSONALIZED)
+ (void)setPersonalizedAdStatus:(NSInteger)status;

/// Synchronously determine whether there is EU traffic (= ATAPI inDataProtectionArea)
+ (BOOL)isEUTraffic;

/// Get area code (async)
+ (void)getAreaWithCompletion:(void (^)(NSString *areaCode))completion;

/// There is no domestic/overseas SDK distinction for iOS, fixed return NO
+ (BOOL)isCnSDK;

/// Set lat/lng (location has latitude / longitude)
+ (void)setLocationWithDictionary:(NSDictionary *)location;

/// Set device information (best-effort is mapped to ATDeviceInfoConfig)
+ (void)setDeviceInformationData:(NSDictionary *)data;

/// Whether network logging is enabled
+ (BOOL)isNetworkLogDebug;

/// Set mediation channel source
+ (void)setChannelSource:(NSInteger)channelFrom;

/// Filter advertising sources/platforms (aligned with Android ATSDK filter family, mapping iOS equivalent API)
+ (void)setFilterAdSourceIdList:(NSString *)placementId list:(NSArray<NSString *> *)list;
+ (void)setFilterNetworkFirmIdList:(NSString *)placementId list:(NSArray<NSString *> *)list;
+ (void)setForbidNetworkFirmIdList:(NSArray<NSString *> *)list;
+ (void)setForbidShowNetworkFirmIdList:(NSString *)placementId list:(NSArray<NSString *> *)list;
+ (void)setAllowedShowNetworkFirmIdList:(NSString *)placementId list:(NSArray<NSString *> *)list;
+ (void)setRiskFilterNetworkFirmIdList:(NSInteger)risk list:(NSArray<NSString *> *)list;

@end

NS_ASSUME_NONNULL_END
