Embed Chat Problems On Mobile

I am having an issue with the embedded chat now trying to launch the application instead of showing the chat. Is there a way to disable this? This was not happening before and I don’t see any documentation about it. Anyone have an idea on how to solve this?

Have you tried using a desktop HTTP_USER_AGENT to make the request? Or maybe use/make a custom websocket client.

My users are having the same problem. Can replicate it myself on iPhone.

That doesn’t make any sense. This is with the chat embed that Twitch provides.

I think this was just changed. I noticed they added Mobile Deep Links to the API so I am wondering if this has something to do with that. I cannot image that this was an intentional change to the mobile embed. Why have the option to embed if they just want to redirect your back to Twitch.

We need to find a way to force the URL to think it’s a desktop, but the problem with that is, since it is an embed code, the redirect happens on Twitch’s end based on the window width. I am not sure if there is anything we can do about that.

https://www.twitch.tv/channelname/chat?no-mobile-redirect=true like the “Switch to Desktop Mode” uses.

1 Like

I don’t understand how it doesn’t make sense. - You are embedding/rending a web page/web content, why couldn’t you add a user_agent?

If I change my useragent on chrome on my desktop to:

Mozilla/5.0 (Linux; Android 7.1.1; Pixel XL Build/NOF27B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.132 Mobile Safari/537.36

Which is what my phone uses by default - I get redirected by the webserver from the request:
Twitch - to - Twitch

of course this was my suggestion before I was reminded about the no-mobile-redirect=true option above. That’s clearly the better solution.

Forgot that existed, Much easier solution!

Web applications that run in the browser (as opposed to an app installed on the phone) don’t have the option to customize user-agent.

Ok, so I was incorrectly assuming it was app installed on the phone, Thanks for the clarification.

I don’t know which it is, just pointing out it won’t work for everyone who comes across this thread.

I guess that’s one way to get around it, but it’s a hacky method and may change at any point.
This shouldn’t be happening at all when using an embed.

1 Like

Maybe we could get a non-redirecting URL officially supported and documented @DallasNChains

1 Like

This works for now. It will at least make it functional again. I appreciate the help!

@DallasNChains any word on this?

I talked to the engineer about this a while ago, and it should be good. Let me know if you’re still seeing the redirect behavior.

@DallasNChains Yeah, still the case. Showing exactly what is in OP, with no way to show the chat.

@moocat Do you have a public website where I can look at this? Every site I’ve tested doesn’t exhibit this behavior, so I’m curious what is triggering this. I’m on an iPhone. Are you Android by chance?

Just tested on my Android without enabling desktop mode and it redirected me to the page with ?no-mobile-redirect=true

Full chat loaded without redirect to app. Works for me. Thanks.

@DallasNChains http://twitch.moobot.tv/r/chat#moobot
Keep in mind that I’m using an account that haven’t dismissed any of those overlays.
Also on iPhone.

@moocat Ah. I can repro this on your site. It’s due to the URL you’re using: http://twitch.tv/chat/embed?channel=moobot&popout_chat=true. The documented chat embed is http://www.twitch.tv/:channel/chat. If you switch to that, you shouldn’t have this issue. :slight_smile:

@DallasNChains Aha, thanks!