android - Facebook image not loading in glide?

只谈情不闲聊 提交于 2019-12-11 06:06:55

问题


so this recently broke for me (not sure if it has to do with the Facebook scandal). But, now I cant load the image url I get back from the facebook login api into glide.

Here's my code.

    private void useFacebookButton()
    {
        facebookButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult)
            {
                Profile profile = Profile.getCurrentProfile();
                playerID = profile.getId();
                firstName = profile.getFirstName();
                lastName = profile.getLastName();
                profileImage = profile.getProfilePictureUri(500,500).toString();
                Glide.with(getActivity().getBaseContext()).load(profileImage).centerCrop().into(someImageView);
            }

            @Override
            public void onCancel()
            {

            }

            @Override
            public void onError(FacebookException error)
            {
                Log.d(TAG,"facebook error :(");
                Log.d(TAG,error.getMessage());
            }
        });
    }

I get a url that comes back as https://graph.facebook.com/<facebookID>/picture?height=500&width=500&migration_overrides=%7Boctober_2012%3Atrue%7D

But glide cannot load that anymore. When I pop it into chrome it doesnt display the image, but forces a download now. And when i download its the correct image. This has just recently happened, it was working fine last week. Dont know if anyone has found a way to fix to this?!?

来源:https://stackoverflow.com/questions/49517345/android-facebook-image-not-loading-in-glide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!