Example #1
0
        public void RefreshCurrentAccessToken(
            FacebookDelegate<IAccessTokenRefreshResult> callback)
        {
            if (callback == null)
            {
                return;
            }

            var result = new Dictionary<string, object>()
            {
                { Constants.CallbackIdKey, this.CallbackManager.AddFacebookDelegate(callback) }
            };

            if (AccessToken.CurrentAccessToken == null)
            {
                result[Constants.ErrorKey] = "No current access token";
            }
            else
            {
                var accessTokenDic = (IDictionary<string, object>)MiniJSON.Json.Deserialize(
                    AccessToken.CurrentAccessToken.ToJson());

                result.AddAllKVPFrom(accessTokenDic);
            }

            this.OnRefreshCurrentAccessTokenComplete(new ResultContainer(result));
        }
        public static IDictionary<string, object> GetResultDictionary(int requestID, IDictionary<string, object> extras)
        {
            var result = new Dictionary<string, object>()
            {
                { Constants.CallbackIdKey, requestID.ToString() }
            };

            if (extras != null)
            {
                result.AddAllKVPFrom(extras);
            }

            return result;
        }
        protected IDictionary<string, object> GetResultDictionary(int requestId)
        {
            var result = new Dictionary<string, object>()
            {
                { Constants.CallbackIdKey, requestId.ToString() }
            };

            var extras = this.ResultExtras;
            if (extras != null)
            {
                result.AddAllKVPFrom(extras);
            }

            return result;
        }