In order to reduce the trouble for developers to update the application version frequently, the SolarEngine introduces online parameter functionality. By delivering parameters, the values of parameters in the application can be adjusted remotely at any time, allowing for application content updates without requiring a new release.
https://solar-sdk.oss-cn-beijing.aliyuncs.com/iOS/SolarEngine-iOS-RC-Plugin-v1.2.6.0.zip
CocoaPods Integrated SDK
pod 'SESDKRemoteConfig' , '~> 1.3.0.3'
Since the Parameter Delivery SDK is a plugin of the SolarEngine SDK, the initialization of the Parameter Delivery SDK depends on the SolarEngine SDK. Please refer to the Android SDK integration documentation for specific details.
Method example:
#import <SolarEngineSDK/SolarEngineSDK.h>
#import <SESDKRemoteConfig/SESDKRemoteConfig.h>
SEConfig *config = [[SEConfig alloc] init];
SERemoteConfig *remoteConfig = [[SERemoteConfig alloc] init];
remoteConfig.enable = YES;
config.remoteConfig = remoteConfig;
[[SolarEngineSDK sharedInstance] startWithAppKey:your_appKey userId:your_userId_SolarEngine config:config];
SERemoteConfig parameter introduction:
Parameter Name | Parameter Meaning | Parameter Type |
---|---|---|
enable | Whether to send initialization parameters to the SDK (Default false) | boolean |
mergeType | Server and SDK merge type (For details, please refer to the explanation below) | enum |
customIDProperties | Custom ID, matches the custom ID set by the user in the background | JSONObject |
customIDEventProperties | Custom ID event property value, matches the custom ID event attribute value set by the user in the background. | JSONObject |
customIDUserProperties | Custom ID user property value, matches the user attribute value set by the user in the background. | JSONObject |
Introduction to mergeType (merge strategy):
Parameter Name | Parameter Meaning |
---|---|
SERCMergeTypeDefault | Use the server configuration to merge with the user's local cache configuration. |
SERCMergeTypeUser | When the app is launched for the first time or the version is updated, use the server configuration to merge with the user's default configuration. This method can clear the local cache configuration. |
Developers who use parameters to deliver the SDK need to preset a default configuration into the App through the API. The SDK uses this default configuration as an alternative.
Method example:
- (void)setDefaultConfig:(NSArray *)defaultConfig;
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
defaultConfig | The default configuration passed by the developer | NSArray | Yes |
Call example:
#import <SESDKRemoteConfig/SESDKRemoteConfig.h>
// defaultConfig default configuration. Each parameter configuration is a dictionary, formatted as follows:
// [
// {
// @"name" : @"k1", // Name of the configuration item, corresponding to the parameter key of the fastFetchRemoteConfig interface
// @"type" : @1, // Type of the configuration item: 1 for string, 2 for integer, 3 for boolean, 4 for json
// @"value" : @"v1", // Value of the configuration item
// }
// ]
NSArray *defaultConfig = @[
@{
@"name":@"key1",
@"value":@"value2",
@"type":@1
},
@{
@"name":@"key2",
@"value":@"value2",
@"type":@1
}
];
[[SESDKRemoteConfig sharedInstance] setDefaultConfig:defaultConfig];
Developers can set custom attributes for events, and the parameter delivery SDK will bring this attribute when requesting server configuration for server-side parameter matching.
Method example:
- (void)setRemoteConfigEventProperties:(NSDictionary *)properties;
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
properties | Custom event properties | NSDictionary | Yes |
Call example:
#import <SESDKRemoteConfig/SESDKRemoteConfig.h>
NSDictionary *properties = @{
@"event_key1":@"event_value1",
@"event_key2":@"event_value1"
};
[[SESDKRemoteConfig sharedInstance] setRemoteConfigEventProperties:properties];
Note:
Please do not pass in custom event properties with keys starting with an underscore "_". The SDK will discard such properties by default.
Developers can set custom attributes for users. The parameter delivery SDK will bring this attribute when requesting server configuration for server-side parameter matching.
Method example:
- (void)setRemoteConfigUserProperties:(NSDictionary *)properties;
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
properties | Custom user properties | NSDictionary | Yes |
Call example:
#import <SESDKRemoteConfig/SESDKRemoteConfig.h>
NSDictionary *properties = @{
@"event_key1":@"event_value1",
@"event_key2":@"event_value1"
};
[[SESDKRemoteConfig sharedInstance] setRemoteConfigUserProperties:properties];
Note:
Please do not pass in custom user properties with keys starting with an underscore "_". The SDK will discard such properties by default.
The parameter delivery SDK provides two methods for retrieving parameter configuration: synchronous and asynchronous.
Note:
When retrieving parameters synchronously or asynchronously, the SDK will trigger an event to report which experiment the user is assigned to. Therefore, it is recommended to retrieve parameters when the user reaches the experimental scenario (retrieving parameters signifies that the user has reached the experimental scenario and entered the experiment associated with that parameter). Please refrain from retrieving parameters prematurely.
Method example:
- (id)fastFetchRemoteConfig:(NSString *)key;
Parameter related:
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
key | Parameter delivery key, corresponds to the parameter key configured by the user in the background. | NSString | Yes |
Return value type: id
Call example:
#import <SESDKRemoteConfig/SESDKRemoteConfig.h>
id data = [[SESDKRemoteConfig sharedInstance] fastFetchRemoteConfig:@"key1"];
if ([data isKindOfClass:[NSString class]]) {
NSString *dataString = (NSString *)data;
}
Method example:
- (void)asyncFetchRemoteConfig:(NSString *)key
completionHandler:(void (^)(id data))completionHandler;
Parameter Name | Parameter Meaning | Parameter Type | Mandatory |
---|---|---|---|
key | Parameter delivery key, corresponds to the parameter key configured by the user in the background. | NSString | Yes |
completionHandler | Parameter delivery asynchronous callback | Block | Yes |
Call example
#import <SESDKRemoteConfig/SESDKRemoteConfig.h>
[[SESDKRemoteConfig sharedInstance] asyncFetchRemoteConfig:@"key1" completionHandler:^(id _Nonnull data) {
if ([data isKindOfClass:[NSString class]]) {
NSString *dataString = (NSString *)data;
}
}];
Method example:
- (NSDictionary *)fastFetchRemoteConfig ;
Call example
#import <SESDKRemoteConfig/SESDKRemoteConfig.h>
NSDictionary *allData = [[SESDKRemoteConfig sharedInstance] fastFetchRemoteConfig];
Method example:
- (void)asyncFetchRemoteConfigWithCompletionHandler:(void (^)(NSDictionary *dict))responseHandle
Call example:
#import <SESDKRemoteConfig/SESDKRemoteConfig.h>
[[SESDKRemoteConfig sharedInstance] asyncFetchRemoteConfigWithCompletionHandler:^(NSDictionary * _Nonnull dict) {
}];
Here is an example of a configuration in JSON string format:
When the value is a dictionary or nested JSON string, please convert the JSON string to string.
Raw data
{
"status": 0,
"data": {
"user_data": {
"nick_name": "哈哈哈",
"account_id": "123456",
"title": "我是谁"
}
}
}
Data set to SDK
"{\"status\":0,\"data\":{\"user_data\":{\"nick_name\":\"哈哈哈\",\"account_id\":\"123456\",\"title\":\"我是谁\"}}}"
Set default data example
NSArray *defaultConfig = @[
@{
@"name": @"key6",
@"type": @1,
@"value": @"{\"status\":0,\"data\":{\"user_data\":{\"nick_name\":\"哈哈哈\",\"account_id\":\"123456\",\"title\":\"我是谁\"}}}",
}
];
[[SESDKRemoteConfig sharedInstance] setDefaultConfig:defaultConfig];
Value example
NSString *value = [[SESDKRemoteConfig sharedInstance] fastFetchRemoteConfig:@"key6"];
NSLog(@"fastFetchRemoteConfig value = %@",value);
// 打印出json字符串 {"status":0,"data":{"user_data":{"nick_name":"哈哈哈","account_id":"123456","title":"我是谁"}}}
NSData *jsonData = [value dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&error];
if (error) {
//解析出错
} else {
NSLog(@"dic = %@",dic);
// 打印出字典对象
// {
// data = {
// "user_data" = {
// "account_id" = 123456;
// "nick_name" = "哈哈哈";
// title = "我是谁";
// };
// };
// status = 0;
}
NSLog(@"nick_name = %@",dic[@"data"][@"user_data"][@"nick_name"]);
// 打印出 nick_name = 哈哈哈
}
————————————
2025-07-03 1.3.0.3
Align SolarEngineSDK 1.3.0.3
2025-06-12 1.3.0.2
Align SolarEngineSDK1.3.0.2
2025-01-17 1.2.9.4
Optimize the JSON configuration of online parameters
2024-12-10 1.2.9.3
Align SolarEngineSDK 1.2.9.3
2024-11-21 1.2.9.2
Align SolarEngineSDK 1.2.9.2
2024-11-06 1.2.9.1
Align SolarEngineSDK 1.2.9.1
2024-10-22 1.2.9.0
2024-09-20 1.2.8.2
Align SolarEngineSDK 1.2.8.2
2024-09-10 1.2.8.1
Align SolarEngineSDK 1.2.8.1
2024-08-16 1.2.8.0
Align SolarEngineSDK 1.2.8.0
2024-07-11 1.2.7.8
Align SolarEngineSDK 1.2.7.8
2024-07-02 1.2.7.7
Align SolarEngineSDK 1.2.7.7
2024-05-13 1.2.7.6
Align SolarEngineSDK 1.2.7.6
2024-04-23 1.2.7.5
Align SolarEngineSDK 1.2.7.5
2024-04-9 1.2.7.4
Align SolarEngineSDK 1.2.7.4
2024-04-9 1.2.7.3
Align SolarEngineSDK 1.2.7.3
2024-04-01 1.2.7.2
Align SolarEngineSDK 1.2.7.2
2024-03-06 1.2.7.1
Align SolarEngineSDK 1.2.7.1
2024-02-02 1.2.7.0
Request parameter configuration optimization.
2023-12-28 1.2.6.1
Align SolarEngineSDK 1.2.6.1
2023-12-14 1.2.6.0
Align SolarEngineSDK 1.2.6.0
2023-11-21 1.2.5.3
Align SolarEngineSDK 1.2.5.3
2023-10-30 1.2.5.1
Align SolarEngineSDK 1.2.5.1
2023-10-12 1.2.5.0
Align SolarEngineSDK 1.2.5.0
2023-10-08 1.2.4.0
Align SolarEngineSDK 1.2.4.0
2023-08-25 1.1.1.1
Depends on SolarEngineSDK 1.2.3.0
2023-07-31 1.1.1.0
Depends on SolarEngineSDK 1.2.2.0
2023-06-01 1.1.0.0
Depends on SolarEngineSDK 1.2.0.0
2023-04-26 1.0.3.0
2023-03-30 1.0.2.0
2023-03-20 1.0.1.0
2023-03-10 1.0.0.1
2023-02-08 1.0.0.0