How to open a link inside a dynamic card view

I’ve created an app with Firebase & Dynamic Component Extension. Now I want - “When the app gets the text from Firebase, it will check if the text is a URL or not. If URL then opens the link inside a Makeroid card view.”
I know how to get data from Firebase. So, I need help from “After getting the text”.

Add the webviewer inside the card view , am not sure how for it will work,

When firebase got text , set web viewer to go to url (get value)…

Simple

Use an if then statement, if text contains http then … else …