Example #1
0
        public void initSocialVk(string par)
        {
            string[] options = JsonHelper.Deserialize <string[]>(par);
            VKSDK.AccessTokenReceived += (sender, args) =>
            {
                System.Diagnostics.Debug.WriteLine("Access token recieved " + args);
                JObject res = new JObject();
                res.Add("token", args.NewToken.AccessToken);
                DispatchCommandResult(new PluginResult(PluginResult.Status.OK, res.ToString()));
                // TODO load user's profile
            };

            VKSDK.CaptchaRequest = (VKCaptchaUserRequest captchaUserRequest, Action <VKCaptchaUserResponse> action) =>
            {
                System.Diagnostics.Debug.WriteLine("Captcha request " + captchaUserRequest);
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Captcha request"));
            };

            VKSDK.AccessDenied += (sender, args) =>
            {
                System.Diagnostics.Debug.WriteLine("Access denied " + args);
                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, "Access denied"));
            };

            VKSDK.Initialize(options[0]);
            VKSDK.WakeUpSession();

            DispatchCommandResult(new PluginResult(PluginResult.Status.OK, "VK Plugin inited"));
        }
Example #2
0
        public MainPage()
        {
            InitializeComponent();
            AuthorizeButton.Click += AuthorizeButtonOnClick;

            VKSDK.Initialize("4460217");

            VKSDK.AccessTokenReceived += (sender, args) =>
            {
                UpdateUIState();
            };

            VKSDK.WakeUpSession();

            VKSDK.CaptchaRequest = CaptchaRequest;

            UpdateUIState();
        }
        public MainPage()
        {
            this.InitializeComponent();
            AuthorizeButton.Click  += AuthorizeButtonOnClick;
            AuthorizeButton2.Click += AuthorizeButton2_Click;
            VKSDK.Initialize("4460217");

            VKSDK.AccessTokenReceived += (sender, args) =>
            {
                UpdateUIState();
            };

            VKSDK.WakeUpSession();

            VKSDK.CaptchaRequest = CaptchaRequest;

            this.NavigationCacheMode = NavigationCacheMode.Required;

            UpdateUIState();
        }
Example #4
0
 private void InitializeSDK()
 {
     VKSDK.Initialize("4460217");
     VKSDK.WakeUpSession();
 }