Exemple #1
0
        public override void API(string method, IDictionary <string, string> queryParams, Action <APICallResponse> callback = null)
        {
            String callbackId = "";

            if (callback != null)
            {
                callbackId = callbackManager.RegisterCallback(callback).ToString();
            }

            List <String> paramsList = new List <String>();

            foreach (var kvp in queryParams)
            {
                paramsList.Add(kvp.Key);
                paramsList.Add(kvp.Value);
            }

            APICallRequest apiCallRequest = new APICallRequest()
            {
                callbackId = callbackId, methodName = method, parameters = paramsList
            };
            string jsonStr = JsonHelper.ToJson(apiCallRequest);

            AndroidNativeHelper.CallStatic("apiCall", jsonStr);
        }
Exemple #2
0
        public override void LogIn(IEnumerable <Scope> scopes, Action <AuthResponse> callback = null)
        {
            base.LogIn(scopes, callback);
            LoginRequest loginRequest = new LoginRequest {
                scopes = scopes.Select(s => Enum.GetName(typeof(Scope), s)).ToList()
            };
            string jsonStr = JsonHelper.ToJson(loginRequest);

            AndroidNativeHelper.CallStatic("login", jsonStr);
        }
Exemple #3
0
        public override void Init(VKInitParams initParams, Action initializedCallback)
        {
            base.Init(initParams, initializedCallback);
            InitRequest initRequest = new InitRequest()
            {
                appId = (int)initParams.AppId, apiVersion = initParams.ApiVersion
            };
            string jsonStr = JsonHelper.ToJson(initRequest);

            AndroidNativeHelper.CallStatic("init", jsonStr);
        }
Exemple #4
0
 public override void LogOut()
 {
     base.LogOut();
     AndroidNativeHelper.CallStatic("logout");
 }