💡Tips
- All custom parameter configurations must be completed before SDK initialization
// UserId
MCSDK.setUserId("your_user_id");
// Channel
MCSDK.setChannel("your_channel");
// Sub-channel
MCSDK.setSubChannel("your_sub_channel");
Map<String, Object> customRule = new HashMap<>();
customRule.put("your_custom_key", "your_custom_value");
MCSDK.setCustomRule(customRule);
public class DemoApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Configure UserId
MCSDK.setUserId("user id");
// Configure channel settings
MCSDK.setChannel("channel");
MCSDK.setSubChannel("sub-channel");
// Configure custom rules
Map<String, Object> customRule = new HashMap<>();
customRule.put("your customized key", "your customized value");
MCSDK.setCustomRule(customRule);
// Initialize SDK
MCSDK.init(this, "your app id", "your app key", new MCInitListener() {
@Override
public void onMediationInitFinished(MCInitResult mcInitResult) {
...
}
});
}
}