Exemplo n.º 1
0
 public string OAuthDialogUri(FBPermissions Permissions, OAuthResponseType ResponseType, string ClientId, string RedirectUri)
 {
     return oauthDialogUri + "/?" +
         "scope=" + "" + "&" +
         "client_id=" + ClientId + "&" +
         "redirect_uri=" + RedirectUri + "&" +
         "response_type=" + Enum.GetName(typeof(OAuthResponseType), ResponseType).ToLower();
         ;
 }
Exemplo n.º 2
0
        public FacebookService()
        {
            sharedFBModel = new SocialModel();
            permissions = new FBPermissions();

            // a set of permissions for use by the app
            permissions.AddUserPermission(FBUserAndFriendPermissions.ABOUT_ME);
            permissions.AddUserPermission(FBUserAndFriendPermissions.BIRTHDAY);
            permissions.AddUserPermission(FBUserAndFriendPermissions.EMAIL);
            permissions.AddFriendsPermission(FBUserAndFriendPermissions.ABOUT_ME);
            permissions.AddExtendedPermission(FBExtendedPermissions.READ_MAILBOX);
            permissions.AddExtendedPermission(FBExtendedPermissions.OFFLINE_ACCESS);
            permissions.AddExtendedPermission(FBExtendedPermissions.READ_STREAM);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Style"></param>
 /// <param name="Permissions"></param>
 /// <param name="ShowFaces"></param>
 /// <param name="DataWidth"></param>
 /// <param name="MaxDataRows"></param>
 /// <returns></returns>
 public string Login(
     CodeStyle       Style,
     string          ButtonText,
     FBPermissions   Permissions = null, 
     bool            ShowFaces=false, 
     int             DataWidth=200, 
     int             MaxDataRows=1)
 {
     string returnHTML = "<div> </div>";
     if (CodeStyle.HTML5 == Style)
     {
         returnHTML = "<div class=\"fb-login-button\" " +
                                     "data-show-faces=\"" + ((true == ShowFaces) ? "true" : "false") + "\" " +
                                     "data-width=\"" + DataWidth + "\" " +
                                     "data-max-rows=\"" + MaxDataRows + "\" " +
                                     ((null != Permissions) ? ("data-perms=\"" + Permissions.CSV + "\"") : "") +
                                     ">" + ButtonText + "</div>";
     }
     else
     {
         Debug.Assert(false, "Only HTML5 supported for login button");
     }
     return returnHTML;
 }
Exemplo n.º 4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="Style"></param>
 /// <param name="RegisterCallbackUri"></param>
 /// <returns></returns>
 public string RegisterOrLogin(
     CodeStyle       Style,
     string          RegisterCallbackUri,
     FBPermissions   Permissions = null)
 {
     string returnHTML = "<div> </div>";
     Debug.Assert(null != RegisterCallbackUri);
     if (CodeStyle.HTML5 == Style)
     {
         // note ---- this only exists in XFBML right now. Cheat for now and return XFBML until FB fixes this
         returnHTML = "<div><fb:login-button " +
                                     "registration-url=\"" + RegisterCallbackUri + "\" " +
                                     ((null != Permissions) ? ("perms=\"" + Permissions.CSV + "\"") : "") +
                                     "/></div>";
     }
     else
     {
         Debug.Assert(false, "Only HTML5 supported for register/login button");
     }
     return returnHTML;
 }