0

I have a problem with fetching user profile images from publis_profile, after initialization of the Facebook app, a month everything worked as expected, the mobile SDK fetched image without a problem, but something changed and I assumed the changes was on Facebook's backend( updated from my side wasn't presented) because the URL of the image of the profile return status code 404. I created a new Facebook app and the problem was the same if I used another way of sending a request from Postman such as GET -> https://graph.facebook.com/ID/picture?height=500&width=500&breaking_change=profile_picture for testing(also used variation with an Access token for this request behavior was the same), the request has status code 200 but the images are placeholder, mobile SDK also return request with 200 status code and object inside have URL of the images but this URL return status code 404, it's an example of this URL https://platform-lookaside.fbsbx.com/platform/profilepic/?asid=3151471181826271&height=200&width=200&ext=1701276382&hash=AeT5F3GKPwRx5E-c-qU

Could you please help me to find out where the is a problem?

Also, I used info from these questions

Facebook iOS SDK and swift: how get user's profile picture

Get Facebook real profile image URL

Getting Facebook Public Profile URLs

Code on mobile side for fetching image

facebookManager.logOut()
facebookManager.logIn(permissions: ["public_profile"], from: UIApplication.shared.rootController()) { result, error in
    if let error = error {
        return
    }
    let request = GraphRequest(graphPath: "me", parameters: ["fields" : "name, id, picture.type(large)"])
    
    if let result = result {
        if !result.isCancelled {
            request.start { _, res, _ in
                guard let data = res as? [String: Any] else {
                    return
                }
                let facebookURL = parceFacebookResponceToImageURL(data: data)
            }
        }
    }
}

fileprivate func parceFacebookResponceToImageURL(data: [String : Any]) -> String? {
    var imageUrl: String?
    if let profilePicObj = data["picture"] as? [String:Any] {
        if let profilePicData = profilePicObj["data"] as? [String:Any] {
            if let profilePic = profilePicData["url"] as? String {
                print("\(profilePic)")
                imageUrl = profilePic
            }
        }
    }
    return imageUrl
}

0