
package com.unity3d.player;

import android.util.Log;

import com.tuyoo.gamesdk.api.SDKAPI;
import com.tuyoo.gamesdk.api.SDKAPIConstant;
import com.tuyoo.gamesdk.api.SDKCallBack;
import com.tuyoo.gamesdk.api.SDKWrapper;

public class SnsTest {
    static final String TAG = "SNSTEST";

    public static void Bind(String type, String guserId)
    {
        SDKAPI.getIns().getSnsInfo(type, (snscode, snsInfo, snsmsg) ->{
            if(snscode == SDKCallBack.CODE_SUCCESS && snsInfo !=null)
            {
                SDKAPI.getIns().bindBySnsId(snsInfo, guserId, (bindcode, bindmsg)->{
                    if(bindcode == SDKCallBack.CODE_SUCCESS)
                    {
                        Log.i(TAG, "LinkSns success");
                    }
                    else
                    {
                        Log.i(TAG, String.format("LinkSns failed, code: %d, msg: %s", bindcode, bindmsg));
                    }
                });
            }
            else
            {
                Log.i(TAG, "getSnsInfo failed");
            }
        });
    }

    public static void Unbind(String type, int userId)
    {

    }
}
