htmliosfacebook-opengraphshare-open-graphios-messages-extension

Signal to iOS that a meta og:image property tag has a content change after page has loaded


I'm implementing og:image tags for a web project. The value in the tag updates asynchronously after the page has loaded and an HTTP call has returned.

iOS seems to pull the content of the tag right at the time of page load and if there is no value there, no image is ever rendered in the Messages app.. even if the value is populated just a few seconds later. Is there any workaround for this?


Solution

  • My research has shown that meta tags need to be fully built when the page is delivered from the server. iOS and other clients like Facebook messenger won't run any JS on your page and so the meta tags need to be fully prepared by the time the HTML doc is delivered.