public string GetUsername()
        {
            FacebookRESTClient client = new FacebookRESTClient(FacebookApiKeys.GetApiKey(), TokenSecret, Token, TokenSecret);
            var user = client.GetLoggedInUser();

            return(user.Name);
        }
Exemplo n.º 2
0
        public bool Disconnect()
        {
            if (client != null)
            {
                client.Dispose();
                client = null;
            }

            return(true);
        }
Exemplo n.º 3
0
        void BuildRestClient()
        {
            if (client == null)
            {
                var sessionKey    = ChannelContext.Current.ClientContext.GetSetting("/Channels/Facebook/SessionKey").ToString();
                var sessionSecret = ChannelContext.Current.ClientContext.GetSetting("/Channels/Facebook/SessionSecret").ToString();

                var apiKey    = FacebookApiKeys.GetApiKey();
                var apiSecret = FacebookApiKeys.GetApiSecret();

                if ("/Settings/Channels/Codebase".AsKey("cloud") == "client")
                {
                    client = new FacebookRESTClient(apiKey, sessionSecret, sessionKey, sessionSecret);
                }
                else
                {
                    client = new FacebookRESTClient(apiKey, apiSecret, sessionKey, sessionSecret);
                }
            }
        }