Hey Guys,
I have a problem with the “open Link” block.
The Url I want to open is somewhat variable. It is created with the “join” block from a fixed url Part and a variable part that enters an article number in our shop. Looks like this:
When I alert it, the Url is created correct. But when I click on the link in the app the behavior is strange. Most of the time 2 tabs in the browser are opened. One with only https://www.sampleshop.com/ and in the background one with the correct url.
Sometimes only the base url is opened…
Any ideas?!
I tried storing the complete url in a variable and handing it to the “open link” block. But that did not help…
Does your URL string contains spaces?
The open link will not process spaces in the URL and will not resolve incomplete URLs even if it is just a missing “http”.
I agree that there could be a special character causing an issue. If you’re able to share the actual URL, that would be helpful. If not, try using the “join” block in the text drawer to add something like a bullet (•) to either side of the URL block you are using. Then display the value in a label and check to make sure it’s what you expect it to be such as:
When I try opening that link in Thunkable Live on iOS or Android, it just loads the page as I’d expect. Do you want to share the project link or screenshots of your blocks? There may be something you’re doing that’s affecting the display of that page.
And just to be clear, if you set a label’s text to the variable shopLink inside of the “when label-Shop-Link Click” block and remove the open link block, you get exactly this?
Ok, so this behaves strange!
I did what you said and removed the “Open Link” block. Then I added “change text of label to the link variable”.
It DID change the text of the label to the correct link. BUT it also opened the link in the browser xD.
So now I did the following. Which does what I wanted to do in the first place. But I don’t think it should behave that way. Just tested it in live view on android. Will test on ios too.
If you disabled/deleted the Open Link block and it still opened a browser on the device then you have a second Open Link block somewhere. Have you tried zooming all the way out on the Blocks tab screen to make sure you don’t have stray code?