示例#1
0
 public void GetBasicUserProfile(ActionSuccessCallback callback = null)
 {
     Debug.Log("Get Basic User Profile");
     if (FB.IsInitialized && FB.IsLoggedIn)
     {
         actionGetBasicUserProfileCallback = callback;
         FB.API("me?fields=id,name", HttpMethod.GET, GetBasicUserProfileCallback);
     }
 }
示例#2
0
 public void GetPictureProfile(ActionSuccessCallback callback = null)
 {
     Debug.Log("Get Picture Profile");
     if (FB.IsInitialized && FB.IsLoggedIn)
     {
         actionGetPictureProfileCallback = callback;
         FB.API("me/picture?type=large&fields=url&redirect=false", HttpMethod.GET, GetPictureProfileCallback);
     }
 }
示例#3
0
 public void GetBasicUserProfile(ActionSuccessCallback callback = null)
 {
     Debug.Log("Get Basic User Profile");
     if (FB.IsInitialized && FB.IsLoggedIn)
     {
         actionGetBasicUserProfileCallback = callback;
         FB.API("me?fields=id,name", HttpMethod.GET, GetBasicUserProfileCallback);
     }
 }
示例#4
0
 public void FeedAPI(LuviFacebookFeedAPI feed, ActionSuccessCallback callback = null)
 {
     Debug.Log("FeedAPI");
     actionFeedAPICallback = callback;
     openFeed = feed;
     WWWForm form = new WWWForm();
     form.AddField("link", openFeed.url);
     form.AddField("name", openFeed.header);
     form.AddField("caption", openFeed.caption);
     form.AddField("description", openFeed.description);
     form.AddField("picture", openFeed.picture);
     form.AddField("actions", "[{'name':'picture','link':'" + openFeed.picture + "'}]");
     FB.API("/me/feed", HttpMethod.POST, FeedAPICallback, form);
 }
示例#5
0
 public void Login(ActionSuccessCallback callback = null)
 {
     if (FB.IsLoggedIn)
     {
         if (callback != null)
         {
             callback(false);
         }
         return;
     }
     Debug.Log("Login|permission: " + defaultPermission);
     actionLoginCallback = callback;
     FB.Login(defaultPermission, LoginCallBack);
 }
示例#6
0
    public void FeedAPI(LuviFacebookFeedAPI feed, ActionSuccessCallback callback = null)
    {
        Debug.Log("FeedAPI");
        actionFeedAPICallback = callback;
        openFeed = feed;
        WWWForm form = new WWWForm();

        form.AddField("link", openFeed.url);
        form.AddField("name", openFeed.header);
        form.AddField("caption", openFeed.caption);
        form.AddField("description", openFeed.description);
        form.AddField("picture", openFeed.picture);
        form.AddField("actions", "[{'name':'picture','link':'" + openFeed.picture + "'}]");
        FB.API("/me/feed", HttpMethod.POST, FeedAPICallback, form);
    }
示例#7
0
 public void OpenFeedDialog(LuviFacebookFeedAPI feed, ActionSuccessCallback callback = null)
 {
     Debug.Log("Open Feed Dialog");
     if (FB.IsInitialized && FB.IsLoggedIn)
     {
         actionFeedDialogCallback = callback;
         openFeed = feed;
         FB.Feed(
             link: openFeed.url,
             linkName: openFeed.header,
             linkCaption: openFeed.caption,
             linkDescription: openFeed.description,
             picture: openFeed.picture,
             callback: OpenFeedCallback
             );
     }
 }
示例#8
0
    public IEnumerator GetPictureProfileFromURL(string url, ActionSuccessCallback callback = null)
    {
        WWW geturl = new WWW(url);

        yield return(geturl);

        if (!string.IsNullOrEmpty(geturl.error))
        {
            Debug.Log("Error to get picture URL");
            if (callback != null)
            {
                callback(false);
            }
            yield break;
        }
        userProfilePicture = new Texture2D(128, 128, TextureFormat.DXT1, false);
        geturl.LoadImageIntoTexture(userProfilePicture);
        Debug.Log("Done to get picture");
        if (callback != null)
        {
            callback(true);
        }
    }
示例#9
0
 public void OpenFeedDialog(LuviFacebookFeedAPI feed, ActionSuccessCallback callback = null)
 {
     Debug.Log("Open Feed Dialog");
     if (FB.IsInitialized && FB.IsLoggedIn)
     {
         actionFeedDialogCallback = callback;
         openFeed = feed;
         FB.Feed(
             link: openFeed.url,
             linkName: openFeed.header,
             linkCaption: openFeed.caption,
             linkDescription: openFeed.description,
             picture: openFeed.picture,
             callback: OpenFeedCallback
         );
     }
 }
示例#10
0
 public void Login(string permission, ActionSuccessCallback callback = null)
 {
     defaultPermission = permission;
     Login(callback);
 }
示例#11
0
 public void Login(ActionSuccessCallback callback = null)
 {
     if (FB.IsLoggedIn)
     {
         if (callback != null) callback(false);
         return;
     }
     Debug.Log("Login|permission: " + defaultPermission);
     actionLoginCallback = callback;
     FB.Login(defaultPermission, LoginCallBack);
 }
示例#12
0
 public IEnumerator GetPictureProfileFromURL(string url, ActionSuccessCallback callback = null)
 {
     WWW geturl = new WWW(url);
     yield return geturl;
     if (!string.IsNullOrEmpty(geturl.error))
     {
         Debug.Log("Error to get picture URL");
         if (callback != null) callback(false);
         yield break;
     }
     userProfilePicture = new Texture2D(128, 128, TextureFormat.DXT1, false);
     geturl.LoadImageIntoTexture(userProfilePicture);
     Debug.Log("Done to get picture");
     if (callback != null) callback(true);
 }
示例#13
0
 public void GetPictureProfile(ActionSuccessCallback callback = null)
 {
     Debug.Log("Get Picture Profile");
     if (FB.IsInitialized && FB.IsLoggedIn)
     {
         actionGetPictureProfileCallback = callback;
         FB.API("me/picture?type=large&fields=url&redirect=false", HttpMethod.GET, GetPictureProfileCallback);
     }
 }
示例#14
0
 public void Login(string permission, ActionSuccessCallback callback = null)
 {
     defaultPermission = permission;
     Login(callback);
 }