package com.draw.painting.test;

import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import androidx.localbroadcastmanager.content.LocalBroadcastManager;

import com.applovin.sdk.AppLovinMediationProvider;
import com.applovin.sdk.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkConfiguration;
import com.applovin.sdk.AppLovinSdkInitializationConfiguration;


public class PaintingApp extends Application {
    public static String Key_ViewDir = "pre_dir";
    public static String Key_ISMAIN = "ismain";
    public static String Key_Camera = "camera_data";
    public static PaintingApp app;
    public static String APP_KEY = "";
    private static Context context;
    public static final String AD_BROADCAST = "on_success_action";
    private static final String MAX_SDK = "27z51PI2aTeTbobe3ORmbnMCb97dZbW8zfHEBfRFzb2DlCRJaTQCNebHHVZ2aepZGpqkvO1J7noD4s8W2UwJew";
    public static Boolean initSDK = false;

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;
        context = getApplicationContext();

        initSDk();

    }

    private void initSDk() {

        AppLovinSdkInitializationConfiguration initConfig = AppLovinSdkInitializationConfiguration.builder(MAX_SDK, this)
                .setMediationProvider(AppLovinMediationProvider.MAX)
                .build();
        AppLovinSdk.getInstance(this).initialize(initConfig, new AppLovinSdk.SdkInitializationListener() {
            @Override
            public void onSdkInitialized(final AppLovinSdkConfiguration sdkConfig) {
                initSDK = true;
                LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(AD_BROADCAST));
            }
        });
    }


}
