本文整理汇总了C#中FacebookDelegate类的典型用法代码示例。如果您正苦于以下问题:C# FacebookDelegate类的具体用法?C# FacebookDelegate怎么用?C# FacebookDelegate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FacebookDelegate类属于命名空间,在下文中一共展示了FacebookDelegate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Post
internal static void Post(
string url,
Dictionary<string, string> formData = null,
FacebookDelegate<IGraphResult> callback = null)
{
Request(url, HttpMethod.POST, formData, callback);
}
示例2: API
public static void API(
string endpoint,
HttpMethod method,
FacebookDelegate callback)
{
if (method != HttpMethod.GET) throw new NotImplementedException();
Task.Run(async () =>
{
FacebookClient fb = new FacebookClient(_fbSessionClient.CurrentAccessTokenData.AccessToken);
FBResult fbResult = null;
try
{
var apiCall = await fb.GetTaskAsync(endpoint, null);
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)
{
Utils.RunOnUnityAppThread(() => { callback(fbResult); });
}
});
}
示例3: Get
internal static void Get(
string url,
Dictionary<string, string> formData = null,
FacebookDelegate callback = null)
{
Request(url, HttpMethod.GET, formData, callback);
}
示例4: FeedRequest
public override void FeedRequest(
string _toId = "",
string _link = "",
string _linkName = "",
string _linkCaption = "",
string _linkDescription = "",
string _picture = "",
string _mediaSource = "",
string _actionName = "",
string _actionLink = "",
string _reference = "",
Dictionary<string, string[]> _properties = null,
FacebookDelegate callback = null)
{
if(!isLoggedIn) return;
string url = "https://graph.facebook.com/" + _toId +"/feed?method=post";
if(_link.Length > 0) url += "&link=" +_toId;
if(_linkName.Length > 0) url += "&name=" +_linkName;
if(_linkCaption.Length > 0) url += "&caption=" +_linkCaption;
if(_linkDescription.Length > 0) url += "&description=" +_linkDescription;
if(_picture.Length > 0) url += "&picture=" +_picture;
if(_mediaSource.Length > 0) url += "&source=" +_mediaSource;
if(_actionName.Length > 0 && _actionLink.Length > 0) {
url += string.Format("&actions=[{\"name\":\"{0}\",\"link\":\"{1}\"}]", _actionName, _actionLink);
}
if(_reference.Length > 0) url += "&type" +_reference;
url += "&access_token=" + accessToken;
StartCoroutine(GetFBResult(url, callback));
}
示例5: Request
public void Request(
Uri url,
HttpMethod method,
IDictionary<string, string> formData = null,
FacebookDelegate<IGraphResult> callback = null)
{
AsyncRequestString.Request(url, method, formData, callback);
}
示例6: API
public static void API(
string endpoint,
HttpMethod method,
FacebookDelegate callback)
{
if(callback != null)
callback(new FBResult());
}
示例7: Login
public override void Login(string scope = "", FacebookDelegate callback = null)
{
if (isLoggedIn)
{
FbDebug.Warn("User is already logged in. You don't need to call this again.");
}
userId = "0";
accessToken = "abcdefghijklmnopqrstuvwxyz";
isLoggedIn = true;
}
示例8: AppRequest
public override void AppRequest(
string message,
string[] to = null,
string filters = "",
string[] excludeIds = null,
int? maxRecipients = null,
string data = "",
string title = "",
FacebookDelegate callback = null)
{
throw new UnityException("There is no Facebook AppRequest on Windows Phone 8");
}
示例9: AppRequest
public override void AppRequest(
string message,
string[] to = null,
string filters = "",
string[] excludeIds = null,
int? maxRecipients = null,
string data = "",
string title = "",
FacebookDelegate callback = null)
{
fb.AppRequest(message, to, filters, excludeIds, maxRecipients, data, title, callback);
}
示例10: Request
internal static void Request(
string url,
HttpMethod method,
WWWForm query = null,
FacebookDelegate<IGraphResult> callback = null)
{
ComponentFactory.AddComponent<AsyncRequestString>()
.SetUrl(url)
.SetMethod(method)
.SetQuery(query)
.SetCallback(callback);
}
示例11: AppRequest
public override void AppRequest(
string message,
OGActionType actionType,
string objectId,
string[] to = null,
List<object> filters = null,
string[] excludeIds = null,
int? maxRecipients = null,
string data = "",
string title = "",
FacebookDelegate callback = null)
{
fb.AppRequest(message, actionType, objectId, to, filters, excludeIds, maxRecipients, data, title, callback);
}
示例12: AppRequest
public override void AppRequest(
string message,
OGActionType actionType,
string objectId,
string[] to = null,
List<object> filters = null,
string[] excludeIds = null,
int? maxRecipients = null,
string data = "",
string title = "",
FacebookDelegate callback = null)
{
FBDebug.Info("App Request dialog is not implemented in the Unity editor.");
}
示例13: AppRequest
public override void AppRequest(
string message,
OGActionType actionType,
string objectId,
string[] to ,
List<object> filters,
string[] excludeIds,
int? maxRecipients ,
string data,
string title,
FacebookDelegate<IAppRequestResult> callback)
{
FacebookLogger.Info("App Request dialog is not implemented in the Unity editor.");
}
示例14: FeedRequest
public override void FeedRequest(
string toId = "",
string link = "",
string linkName = "",
string linkCaption = "",
string linkDescription = "",
string picture = "",
string mediaSource = "",
string actionName = "",
string actionLink = "",
string reference = "",
Dictionary<string, string[]> properties = null,
FacebookDelegate callback = null)
{
FBDebug.Info("Feed dialog is not implemented in the Unity editor.");
}
示例15: FeedRequest
public override void FeedRequest(
string toId = "",
string link = "",
string linkName = "",
string linkCaption = "",
string linkDescription = "",
string picture = "",
string mediaSource = "",
string actionName = "",
string actionLink = "",
string reference = "",
Dictionary<string, string[]> properties = null,
FacebookDelegate callback = null)
{
fb.FeedRequest(toId, link, linkName, linkCaption, linkDescription, picture, mediaSource, actionName, actionLink, reference, properties, callback);
}