# Bugs Affecting Twitch Extensions on Mobile Devices

**URL:** <https://discuss.dev.twitch.com/t/bugs-affecting-twitch-extensions-on-mobile-devices/59775>\
**Category:** Extensions\
**Created:** [August 1, 2024, 2:54pm UTC](https://discuss.dev.twitch.com/t/bugs-affecting-twitch-extensions-on-mobile-devices/59775 "2024-08-01T14:54:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Turna](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/turna/32/27919_2.png) [@Turna](https://discuss.dev.twitch.com/u/Turna)\
**Post date:** [August 1, 2024, 2:54pm UTC](https://discuss.dev.twitch.com/t/bugs-affecting-twitch-extensions-on-mobile-devices/59775/1 "2024-08-01T14:54:58Z")

</div>

Hello,

We’ve identified two different issues that occur on mobile.

**On Android:**  
Extension icons are visible only the first time you open a channel on the Twitch app. When you return to the Twitch app home and then open the same channel or another one, the icons are no longer visible. This issue is reproducible and is still happening with the latest update. It was first reported on October 24, 2023, in the Twitch Dev Discord. I believe this issue is affecting all extension owners and the overall Twitch experience.

 ![Pic](https://d2opxh93rbxzdn.cloudfront.net/original/3X/d/5/d548fae93e313d5d41f4ffeb706da54cc9554647.jpeg)  
 ![photo_5890925951934643608_y](https://d2opxh93rbxzdn.cloudfront.net/original/3X/5/f/5f42533da8e9e97c08db35b0e90baf7d1ac110dd.jpeg)

**On iOS:**  
Since the latest update, when an extension is active and you go back to the chat, the extension stops listening to PubSub. Specifically, we have found that the “window.Twitch.ext.listen: void function(target: String, callback: Function)” function is no longer working, whereas it was functioning before the latest update.

**On Android**

the flow is different, as it appears the extension shuts down when you open the chat and then reruns if you click on the extension icon/name again.

To reproduce this issue: open a Twitch channel on iOS, open an extension (we tested with our extension Live Bingo), go to chat, wait for the event to happen (like a number drawn), then go back to the extension.

Thank you for your attention to these issues.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [August 1, 2024, 4:58pm UTC](https://discuss.dev.twitch.com/t/bugs-affecting-twitch-extensions-on-mobile-devices/59775/2 "2024-08-01T16:58:21Z")

</div>

> [@Turna](#):
>
> Since the latest update, when an extension is active and you go back to the chat, the extension stops listening to PubSub. Specifically, we have found that the “window.Twitch.ext.listen: void function(target: String, callback: Function)” function is no longer working, whereas it was functioning before the latest update

I couldn’t repro this one on my iOS device with the current Twitch App and the described flow.

I did:

- open channel
- open kitchen sink test extension
- sent a pubsub from EBS/test
- check recieved a pubsub (it was)
- went back to chat
- sent a pubsub from EBS/test
- reopend the extension
- log showed recieved message

Recieved visibility false  
Recieved global message  
a second later reopened visiblity true

 ![IMG_0467.PNG](https://d2opxh93rbxzdn.cloudfront.net/original/3X/6/4/648b1a275a7470c5db6d9e99c4821b170f01bac6.jpeg)

~~waiting to cross check droid as my droid needs to update first.~~

have confirmed your android issue of

- open chat
- open extension
- go back to chat
- go back to extension

and it full loads instead of “remembers state”

---

<div class="post-metadata">

**Author:** ![Turna](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/turna/32/27919_2.png) [@Turna](https://discuss.dev.twitch.com/u/Turna)\
**Post date:** [August 5, 2024, 3:11pm UTC](https://discuss.dev.twitch.com/t/bugs-affecting-twitch-extensions-on-mobile-devices/59775/4 "2024-08-05T15:11:05Z")

</div>

Hello. I’ve sent you a video on Discord showing how we were able to reproduce the iOS bug. As for the Android issue, do you know if there’s a chance it will be fixed in the future? We first discovered this problem in October 2023. Thank you!

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [August 5, 2024, 3:29pm UTC](https://discuss.dev.twitch.com/t/bugs-affecting-twitch-extensions-on-mobile-devices/59775/5 "2024-08-05T15:29:33Z")

</div>

> [@Turna](#):
>
> As for the Android issue, do you know if there’s a chance it will be fixed in the future? We first discovered this problem in October 2023.

No idea I’m not staff so no insight on the issue

> [@Turna](#):
>
> I’ve sent you a video on Discord showing how we were able to reproduce the iOS bug

Not too much good there, since it got stuck in the discord spam filter and if legit but needs to be here on the thread for those with the power to fix it to see/confirm.

I did the same steps and couldn’t replicate your fault

I did

- open channel
- open extension
- trigger a pubsub
- check it was recieved, it was
- close by going back to chat
- trigger a pubsub
- open the extension
- check it was recieved, it was

So it seems like your extension is not drawing/marking [5] as selected rather than pubsub is not being recieved.

So your dom selector isn’t selecting the item for some reason. Or marking it as such when it’s reopened. Which is a common thing people miss when the dom is essentially “not visibile”

You either need to do a full state recheck when `onVisibilityChanged` becomes true, or some other sync function. (or at least this works as a work around for any missed events)

So you need potentially additional logging and trace where the fault is, I _suspect_ the fault is in your code and it’s dom selection not that you didn’t recieve the pubsub message at all. As I can’t replicate it using your steps at the moment.

**Edit** : the only time I could replicate it was whilst trying to video it whilst trying to capture the non replication, and that was intermittent/not 100% repro then…

So seems something _might_ be awry but I can’t 100% for sure where the fault is as it’s not 100% faulting _all_ the time

I’m gonna tinker and get a cleaner/testable/more reliable repro case with additional logging when I get time

**Additionally given**

> **[Extensions Reference](https://dev.twitch.tv/docs/extensions/reference/#onvisibilitychanged)**
>
> Extensions Reference

> When an extension is not visible, it does not receive `onContext` updates and must perform only minimal work in the background.

So it might be “correct” on the behaviour, or a potential “won’t fix”

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [August 5, 2024, 4:17pm UTC](https://discuss.dev.twitch.com/t/bugs-affecting-twitch-extensions-on-mobile-devices/59775/6 "2024-08-05T16:17:53Z")

</div>

Filed as

> <https://github.com/twitchdev/issues/issues/977>
>
> \*\*Brief description\*\*
> 
> If you open an extension to start it, then go back to c…hat, then return to the extension pubsub messaging is missed whilst the extension was "closed"
> 
> \*\*How to reproduce\*\*
> 
> On mobile
> 
> \- open an extension
> \- recieve some pubsub
> \- Return to chat
> \- attempt to recieve some pubsub
> \- Go back to the extension
> \- see pubsub wasn't recieved
> 
> \*\*Expected behavior\*\*
> 
> \- PubSub recieve
> 
> \*\*Screenshots\*\*
> 
> \*\*Additional context or questions\*\*
> 
> \`onVisibilityChanged\` does trigger and previous log present so the extensions is "awake" it seems just not recieving pubsub
> 
> I'm pending writing a better repro case/test code
> 
> Original report: https://discuss.dev.twitch.com/t/bugs-affecting-twitch-extensions-on-mobile-devices/59775/
> 
> I could only semi reliably repro it \_when\_ my phone was recording… which is weirder
> 
> \*\*Work around\*\*
> 
> Extensions can use \`onVisibilityChanged\` becoming \`true\` to trigger a state reload

and

> <https://github.com/twitchdev/issues/issues/978>
>
> \*\*Brief description\*\*
> 
> On android an extension is destoryed instead of "put to… sleep" compared to iOS
> 
> \*\*How to reproduce\*\*
> 
> On mobile
> 
> \- open an extension
> \- Return to chat
> \- Go back to the extension
> \- extension full loads instead of persists state
> 
> \*\*Expected behavior\*\*
> 
> Android and iOS behave the same
> 
> \*\*Screenshots\*\*
> 
> \*\*Additional context or questions\*\*
> 
> Similar to #977 I suspect if this issue didn't occur 977 would occur on 'droid
