本文整理汇总了C#中Facebook.FacebookClient.DeleteTaskAsync方法的典型用法代码示例。如果您正苦于以下问题:C# FacebookClient.DeleteTaskAsync方法的具体用法?C# FacebookClient.DeleteTaskAsync怎么用?C# FacebookClient.DeleteTaskAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook.FacebookClient
的用法示例。
在下文中一共展示了FacebookClient.DeleteTaskAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: API
/// <summary>
/// For platforms that do not support dynamic cast it to either IDictionary<string, object> if json object or IList<object> if array.
/// For primitive types cast it to bool, string, dobule or long depending on the type.
/// Reference: http://facebooksdk.net/docs/making-asynchronous-requests/#1
/// </summary>
public static void API(
string endpoint,
HttpMethod method,
FacebookDelegate callback,
object parameters = null)
{
#if NETFX_CORE
Task.Run(async () =>
{
FacebookClient fb = new FacebookClient(_fbSessionClient.CurrentAccessTokenData.AccessToken);
FBResult fbResult = null;
try
{
object apiCall;
if (method == HttpMethod.GET)
{
apiCall = await fb.GetTaskAsync(endpoint, parameters);
}
else if (method == HttpMethod.POST)
{
apiCall = await fb.PostTaskAsync(endpoint, parameters);
}
else
{
apiCall = await fb.DeleteTaskAsync(endpoint);
}
if (apiCall != null)
{
fbResult = new FBResult();
fbResult.Text = apiCall.ToString();
fbResult.Json = apiCall as JsonObject;
}
}
catch (Exception ex)
{
fbResult = new FBResult();
fbResult.Error = ex.Message;
}
if (callback != null)
{
Dispatcher.InvokeOnAppThread(() => { callback(fbResult); });
}
});
#else
throw new PlatformNotSupportedException("");
#endif
}
示例2: UnlinkFaceBook
public async void UnlinkFaceBook()
{
if(!HasConnection || UserPreference.AccessKey==null)
return;
var fb = new FacebookClient(UserPreference.AccessKey) { AppId = AppId };
await fb.DeleteTaskAsync(string.Format("https://graph.facebook.com/{0}/permissions", UserPreference.FbUserId));
UserPreference.AccessKey = null;
UserPreference.FbUserId = null;
UserPreference.Name = null;
SaveSettings();
NotifyPropertyChanged("AccessKey");
}
示例3: DeleteFacebookRequestAsync
public Task<object> DeleteFacebookRequestAsync(string requestId, long userId, string accessToken)
{
string final = string.Format("{0}_{1}", requestId, userId);
var fb = new FacebookClient(accessToken);
return fb.DeleteTaskAsync(final);
}