package com.unity.EndlessRunnerSampleGame.TkeDemo.wxapi; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import com.tencent.mm.opensdk.constants.ConstantsAPI; import com.tencent.mm.opensdk.modelbase.BaseReq; import com.tencent.mm.opensdk.modelbase.BaseResp; import com.tencent.mm.opensdk.modelmsg.SendAuth; import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler; import com.hw.unity.Agc.Auth.ThirdPartyLogin.WXHelperT; public class WXEntryActivity extends Activity implements IWXAPIEventHandler { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { Intent intent = getIntent(); WXHelperT.getApi().handleIntent(intent, this); } catch (Exception e) { e.printStackTrace(); } } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); WXHelperT.getApi().handleIntent(intent, this); } @Override public void onReq(BaseReq baseReq) { } @Override public void onResp(BaseResp baseResp) { if (baseResp.getType() == ConstantsAPI.COMMAND_SENDAUTH) { SendAuth.Resp authResp = (SendAuth.Resp) baseResp; WXHelperT.getToken(authResp.code); } finish(); } }