private string PromoteSession(bool isAsync, PromoteSessionCallback callback, Object state) { var parameterList = new Dictionary <string, string> { { "method", "facebook.auth.promoteSession" } }; if (isAsync) { SendRequestAsync <auth_promoteSession_response, string>(parameterList, new FacebookCallCompleted <string>(callback), state); return(null); } var response = SendRequest <auth_promoteSession_response>(parameterList); return(response == null ? null : response.TypedValue); }
private string PromoteSession(bool isAsync, PromoteSessionCallback callback, Object state) { var parameterList = new Dictionary<string, string> { { "method", "facebook.auth.promoteSession" } }; if (isAsync) { SendRequestAsync<auth_promoteSession_response, string>(parameterList, new FacebookCallCompleted<string>(callback), state); return null; } var response = SendRequest<auth_promoteSession_response>(parameterList); return response == null ? null : response.TypedValue; }
/// <summary> /// Returns a temporary session secret associated to the current existing session, for use in a client-side component to an application. /// </summary> /// <example> /// <code> /// private static void RunDemoAsync() /// { /// Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey)); /// api.Auth.PromoteSessionAsync(AsyncDemoCompleted, null); /// } /// /// private static void AsyncDemoCompleted(string result, Object state, FacebookException e) /// { /// var actual = result; /// } /// </code> /// </example> /// <param name="callback">The AsyncCallback delegate</param> /// <param name="state">An object containing state information for this asynchronous request</param> /// <returns>This method creates a temporary session secret for the current (non-infinite) session of a Web application.</returns> public void PromoteSessionAsync(PromoteSessionCallback callback, Object state) { PromoteSession(true, callback, state); }