Skip to content
Advertisement

Problem sharing panoramic (360º) images on Facebook with Open Graph API

For the past few days I’ve been trying to share a image (this one: https://cdn.mooble.com/render-images/BD8F1639613D4A3D8E763D4C4B45C.jpg) on Facebook and I can’t get it to work with the interactive 360º view.

If you download the image from the link and upload it manually the image works automatically, but I need to do it through the API.

I’ve already tried it the FB.ui with method: ‘share’ and passing the image URL, but the image stays static.

Also tried with FB.api posting on “/me/photos” (which is the one that have the allow_spherical_photo parameter) but I got this response:

“This endpoint is deprecated since the required permission publish_actions is deprecated”.

Code:

   window.FB.login((response) => {
            console.log(response);
            if (response.status === "connected") {
                window.FB.getLoginStatus((response) => {
                    if (response.status == "connected") {
                        window.FB.api(
                            '/' + response.authResponse.userID + '/photos',
                            'POST',
                            {
                                "url": "https://cdn.mooble.com/render-images/BD8F1639613D4A3D8E763D4C4B45C.jpg",
                                "allow_spherical_photo": "true",
                            },
                            (data) => {
                                console.log(data);
                            });
                    }
                });
            }
        }, { scope: 'user_posts' });

So I’ve tried the “/me/feed” method which is supposed to be “newer” and it also doesn’t work, this is the response:

“If posting to a group, requires app being installed in the group, and either publish_to_groups permission with user token, or both manage_pages and publish_pages permission with page token; If posting to a page, requires both manage_pages and publish_pages as an admin with sufficient administrative permission”.

 window.FB.login((response) => {
            console.log(response);
            if (response.status === "connected") {
                window.FB.getLoginStatus((response) => {
                    if (response.status == "connected") {
                        window.FB.api(
                            '/' + response.authResponse.userID + '/feed',
                            'POST',
                            {
                                "url": "https://cdn.mooble.com/render-images/BD8F1639613D4A3D8E763D4C4B45C.jpg",
                                "allow_spherical_photo": "true",
                            },
                            (data) => {
                                console.log(data);
                            });
                    }
                });
            }
        }, { scope: 'user_posts' });

The permissions are given and I am not trying to post on some group or page, just on the user profile/ timeline.

Does anyone know how to solve this problem or if it exists any other way to post the image?

There is a Online API Explorer which is really helpful for testing the requests, if you want to use it to help me https://developers.facebook.com/tools/explorer/228851740637565?method=POST&path=me%2Ffeed&version=v4.0&url=https%3A%2F%2Fcdn.mooble.com%2Frender-images%2FBD8F1639613D4A3D8E763D4C4B45C.jpg&allow_spherical_photo=true

Advertisement

Answer

As it was awnsered in the comments by misorude

You can not post to user timelines via API any more

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement