How to render facebook,twitter URL in ionic 5 app

Can anyone please let me know how to render Facebook and Twitter URL in Ionic app ?
I am trying to do it using iframe as below, but it is not working.

<iframe class="webPage" frameborder="0" name="eventsPage" src="" allowfullscreen></iframe>

But getting below error:

Refused to display ‘’ in a frame because it set ‘X-Frame-Options’ to ‘deny’.

Any help would be appreciated.

You shouldn’t be doing this, to be honest. If you need to load an external site, you could use capacitor’s browser plugin,

But loading other sites as an iframe is

  1. Bad user experience
  2. Deceiving
  3. A fast way to get any app rejected by the app stores.

Thanks for the reply and suggestion.
As per the requirement I need to render URL in app , can’t open in browser.

So is there any way other then using iframe ?

Not if facebook/twitter have set the x-frame-options on in their header.

You need to change your requirements or tell your client/boss that it is not possible due to Facebook/Twitter not allowing it.

This is not an Ionic issue, just the nature of how websites can block being embedded.

This also acceptable?

@Tommertom Thank you for providing this link.
Do you know how can we get embed URL of Instagram and Youtube like this?

Google is your best friend

Type embed youtube and then you will have an answer