Пример #1
0
        private async Task <Uri> GetLoginUrl(string permissions)
        {
            var parameters = new Dictionary <string, object>();

            String appId = await AppAuthenticationHelper.GetFacebookConfigValue("Facebook", "AppId");

            parameters["client_id"]     = appId;
            parameters["redirect_uri"]  = "https://www.facebook.com/connect/login_success.html";
            parameters["response_type"] = "token";
#if WP8 || WINDOWS_PHONE
            parameters["display"] = "touch";
            parameters["mobile"]  = true;
#else
            parameters["display"] = "popup";
#endif

            // add the 'scope' only if we have extendedPermissions.
            if (!string.IsNullOrEmpty(permissions))
            {
                // A comma-delimited list of permissions
                parameters["scope"] = permissions;
            }

            var client = new FacebookClient();
            return(client.GetLoginUrl(parameters));
        }
Пример #2
0
        private Uri GetLoginUrl(string permissions)
        {
            var parameters = new Dictionary <string, object>();

            parameters["client_id"]     = this.AppId;
            parameters["redirect_uri"]  = "https://www.facebook.com/connect/login_success.html";
            parameters["response_type"] = "token";
#if WINDOWS_PHONE
            parameters["display"] = "touch";
#else
            parameters["display"] = "popup";
#endif

            // add the 'scope' only if we have extendedPermissions.
            if (!string.IsNullOrEmpty(permissions))
            {
                // A comma-delimited list of permissions
                parameters["scope"] = permissions;
            }

            var client = new FacebookClient();
            return(client.GetLoginUrl(parameters));
        }