package com.composition.android.ad.gromore.impl

import android.content.Context
import com.bytedance.msdk.api.v2.*
import com.composition.android.lib.ad.AdManager
import com.composition.android.lib.ad.interfaces.Initialize

/**
 * @classname:
 * @author: LiuXiaoLong
 * @date: 2022/9/15
 * description:GroMore SDK初始化
 */
class GroMoreInitialize(var appId : String) : Initialize {


    override fun init(context: Context) {

        GMMediationAdSdk.initialize(context, GMAdConfig.Builder()
            .setAppId(appId)
            .setAppName(context.packageName)
            .setDebug(AdManager.instance.isDebug)
            .setOpenAdnTest(false)
            .setPangleOption(GMPangleOption.Builder()
                .setIsPaid(false)
                .setTitleBarTheme(GMAdConstant.TITLE_BAR_THEME_DARK)
                .setAllowShowNotify(true)
                .setAllowShowPageWhenScreenLock(true)
                .setDirectDownloadNetworkType(GMAdConstant.NETWORK_STATE_WIFI)
                .setIsUseTextureView(true)
                .setNeedClearTaskReset()
                .setKeywords("")
                .build())
            .setPrivacyConfig(object : GMPrivacyConfig(){
                override fun isCanUsePhoneState(): Boolean {
                    return false
                }

                override fun getMacAddress(): String {
                    return ""
                }

                override fun getAgeGroup(): GMAdConstant.ADULT_STATE {
                    return GMAdConstant.ADULT_STATE.AGE_ADULT
                }
            })
            .build())
    }
}