package com.cocos.game;

import android.app.Application;

import androidx.core.content.res.ResourcesCompat;

import com.atmob.cocos.bridge.AtmobCocosBridge;
import com.atmob.cocos.bridge.Config;
import com.atmob.cocos.bridge.YiDunProtectConfig;
import com.atmob.compliance.AtmobCompliance;
import com.game.eliminate.BuildConfig;
import com.game.eliminate.R;

public class GameApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        AtmobCocosBridge.getInstance().init(this, new Config.Builder()
                .serverHost(BuildConfig.IS_PROD_SERVER ? BuildConfig.PROD_SERVER_HOST : BuildConfig.TEST_SERVER_HOST)
                .debug(BuildConfig.DEBUG)
                .testChannel(BuildConfig.TEST_CHANNEL)
                .appKey(BuildConfig.ATMOB_CENTRAL_APP_KEY)
                .gravityAccessToken(BuildConfig.GRAVITY_ACCESS_TOKEN)
                .wechatAppId(BuildConfig.WECHAT_APP_ID)
                .alipayAppId(BuildConfig.ALIPAY_APP_ID)
                .yiDunProtectConfig(new YiDunProtectConfig(BuildConfig.YIDUN_PRODUCT_ID, BuildConfig.YIDUN_REGISTER_BUSINESS_ID))
                .complianceStrategy(AtmobCompliance.Strategy.CHINA)
                .startSceneDrawable(ResourcesCompat.getDrawable(getResources(), R.drawable.bg_splash_theme, null))
                .build());
    }
}
