mergemilitary/Assets/Plugins/ToukaGames/AnalyticsSDK/Tools/UMRemoteConfig.framework/Headers/UMRemoteConfig.h

116 lines
3.4 KiB
C
Raw Normal View History

2022-05-23 13:39:59 +00:00
//
// UMRemoteConfig.h
// myFireBase
//
// Created by 张军华 on 2019/12/30.
// Copyright © 2019年 张军华. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "UMRemoteConfigEnum.h"
NS_ASSUME_NONNULL_BEGIN
typedef void (^UMRemoteConfigFetchCompletion)(UMRemoteConfigFetchStatus status,
NSError *_Nullable error);
typedef void (^UMRemoteConfigActivateCompletion)(NSError *_Nullable error);
@protocol UMRemoteConfigDelegate<NSObject>
@optional
/**
* @brief
* @param status see UMRemoteConfigFetchStatus
* @param error
* @param userInfo
* @note
* fetchWithCompletionHandler
* fetchAndActivateWithCompletionHandler
*/
-(void)remoteConfigFetched:(UMRemoteConfigFetchStatus)status
error:(nullable NSError*)error
userInfo:(nullable id)userInfo;
/**
* @brief
* @param status see UMRemoteConfigActiveStatus
* @param error
* @param userInfo
* @note
* fetchAndActivateWithCompletionHandler
* activateWithCompletionHandler
*/
-(void)remoteConfigActivated:(UMRemoteConfigActiveStatus)status
error:(nullable NSError*)error
userInfo:(nullable id)userInfo;
/**
* @brief
* @param status see UMRemoteConfigActiveStatus
* @param error
* @param userInfo
* @note
* fetchWithCompletionHandler
*/
-(void)remoteConfigReady:(UMRemoteConfigActiveStatus)status
error:(nullable NSError*)error
userInfo:(nullable id)userInfo;
@end
@class UMRemoteConfigSettings;
@interface UMRemoteConfig : NSObject
@property(nonatomic,weak)id<UMRemoteConfigDelegate> remoteConfigDelegate;
@property(nonatomic, readwrite, strong) UMRemoteConfigSettings *configSettings;
#pragma mark - init
/**
* @brief
* @param delegate see UMRemoteConfigDelegate
* @note
remoteConfigWithDelegate:(id<UMRemoteConfigDelegate>)delegateready的数据可以回调给用户
*/
+ (UMRemoteConfig *)remoteConfigWithDelegate:(nullable id<UMRemoteConfigDelegate>)delegate
withConfigSettings:(nullable UMRemoteConfigSettings*)configSettings;
+ (UMRemoteConfig *)remoteConfig;
#pragma mark - activate
/**
* @brief
* @param completionHandler
*/
+ (void)activateWithCompletionHandler:(nullable UMRemoteConfigActivateCompletion)completionHandler;
#pragma mark - Get Config
/**
* @brief
* @param key key
* @note ->Defaults
*/
+ (nullable id)configValueForKey:(nullable NSString *)key;
#pragma mark - Defaults
/**
* @brief
* @param defaults
*/
+ (void)setDefaults:(nullable NSDictionary<NSString *, NSObject *> *)defaults;
/**
* @brief
* @param fileName plist文件
*/
+ (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName;
+(NSString*)sdkVersion;
@end
NS_ASSUME_NONNULL_END