amp-story-social-share Not working
Description
@mszylkowski Is this feature
Reproduction Steps
Relevant Logs
No response
Browser(s) Affected
Chrome
AMP Version Affected
Latest
Hi! Seems like the server has an internal error when fetching the bookend.json with the parameters passed by AMP. Make sure that the server succeeds when sending the request. Also, with a properly configured social-share, the share providers will be shown properly when clicking on the share icon on the story, but it should not trigger the share dialog automatically when reaching the end. For that purpose, you can configure amp-story-player events and render your own UI on top of the player.
This is the request my browser made to the server, which is returning the 500 error (Internal server error):
curl 'https://travel.visualstories.com/quizzes/is-your-knowledge-of-greenland-evergreen/bookend.json?__amp_source_origin=file%3A%2F%2F' \
-H 'Connection: keep-alive' \
-H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"' \
-H 'Accept: application/json' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36' \
-H 'Origin: null' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Accept-Language: en-US,en;q=0.9,es-UY;q=0.8,es;q=0.7' \
--compressed
@mszylkowski Thank you so much for the help.
@mszylkowski Will this JSON work? https://testweb.visualstories.com/test-auto-advance-release/bookend.json?utm_source=visualstories.com
{"bookendVersion":"v1.0","shareProviders":[{"provider":"facebook","app_id":"56756756756"},"twitter","pinterest","linkedin","tumblr","whatsapp","email","sms"]}
The existing JSON was https://testweb.visualstories.com/test-auto-advance-release/bookend.json which includes all the data regarding related stories and credit text and credit URL's
Yes, both JSONs should work. You can tell if a JSON would work if you add it to the story inline like so:
<amp-story-social-share>
<script type="application/json">
{
"bookendVersion":"v1.0",
"shareProviders":[{"provider":"facebook","app_id":"56756756756"},"twitter","pinterest","linkedin","tumblr","whatsapp","email","sms"]
}
</script>
</amp-story-social-share>
The problem seems to be that when you make the HTTP request to your server, it returns 500 - Internal Server Error at least when I tested that URL on a test story I made (it works when I open the URL on the browser directly though). If you check on the Network tab of your browser, the request should succeed in order to retrieve the config.

@mszylkowski Thank you so much. I will check the inline part at my end and also solve the 500 - Internal Server Error issue.
Hi... @mszylkowski
- I have changed the code as to said ~ https://testweb.visualstories.com/test-auto-advance-release
- It's showing an AMP Error "The mandatory attribute 'layout' is missing in tag 'amp-story-social-share'"
- So, I added layout="nodisplay" ~ https://vs-subdomain-appsites.azurewebsites.net//testweb.visualstories.com/test-auto-advance-release
- Now the AMP Error issue is solved.
- Is this the correct implementation?
Yes! I can see all the share providers when clicking on the share icon, so seems like the configuration is working
@mszylkowski Great, Can you share the screenshot of share icon ?
=>

@mszylkowski Thank you so much for your support. So I'll be adding layout in my final release.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.