【问题标题】:Ionic Facebook Profile picture showing very smallIonic Facebook 个人资料图片显示非常小
【发布时间】:2019-08-19 04:59:27
【问题描述】:

我在我的应用程序中使用 ionic native facebook 进行 facebook 登录。所有的事情都很好,但问题是当我获取用户数据时,这个用户的个人资料图片太小了。当我获取用户数据时,数据中有 photoURL,但这个 URL 太小了,比如 30x30。有谁知道问题出在哪里,或者有其他方法可以获取个人资料图片吗?

【问题讨论】:

    标签: facebook ionic-framework


    【解决方案1】:

    传图片宽高picture.width(720).height(720)this.fb.api(dataquery, [])

      fbSignup() {
        const dataquery = "me?fields=id,name,email,first_name,picture.width(720).height(720).as(picture_large)";
        this.fb.login(['email', 'public_profile']).then((response: FacebookLoginResponse) => {
          this.fb.api(dataquery, []).then(profile => {
            this.userData = { email: profile['email'], first_name: profile['first_name'], picture: profile['picture_large']['data']['url'], username: profile['name'] }
    
            console.log("User Data :" + JSON.stringify(response))
    
          });
        });
      }
    

    【讨论】:

      【解决方案2】:

      我通过在 photoUrl 中添加 /picture?height=500 来解决它 示例:photoUrl = "https://graph.facebook.com/" + facebookUserId + "/picture?height=500"

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-06-08
        • 1970-01-01
        • 1970-01-01
        • 2017-09-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多