package com.adealink.weparty.im.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.adealink.weparty.im.config.InitSetting;
import com.google.auto.service.AutoService;
import com.tencent.qcloud.tuicore.ServiceInitializer;
import com.tencent.qcloud.tuicore.annotations.TUIInitializerDependency;
import com.tencent.qcloud.tuicore.annotations.TUIInitializerID;
import com.tencent.qcloud.tuicore.interfaces.ITUIService;
import com.tencent.qcloud.tuicore.interfaces.TUIInitializer;

@AutoService(TUIInitializer.class)
@TUIInitializerDependency("TIMCommon")
@TUIInitializerID("TIMAppService")
public class TIMAppService implements TUIInitializer, ITUIService {
    public static final String TAG = TIMAppService.class.getSimpleName();
    private static TIMAppService instance;

    public static TIMAppService getInstance() {
        return instance;
    }

    public Context mContext;

    private InitSetting initSetting;

    @Override
    public void init(Context context) {
        instance = this;
        mContext = context;

        initSetting = new InitSetting(mContext);
        initSetting.init();
    }


    public void initBeforeLogin(int sdkappid) {
        if (initSetting == null) {
            initSetting = new InitSetting(mContext);
        }

        initSetting.initBeforeLogin(sdkappid);
    }

    public static Context getAppContext() {
        return ServiceInitializer.getAppContext();
    }
}
