Programming Phoenix chat example - iPhone lack of socket updates

I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a user log in, open a websocket and a channel specific to that user, and wait for updates.

When we send a message to that user via their channel, we see the message without issue on a Windows system (all major browsers), Linux (Chrome) and AndroidOS (Chrome). However, if we go to the application on an iPhone via Chrome, we dont see the message when it’s pushed to the channel. No alert is generated indicating the message was even received.

I’ve seen some talk about webRTC sockets not working on an iPhone and was wondering if this is the case or not?

Edit: For clarity

Did you check with an android phone?

:wave:

What does webrtc have to do with phoenix channels? Do you mean websockets? Can you post some code from the ios app?


Just in case, yes, webrtc on ios browsers has limited support as of now, and works only in safari.

Yes - I unfortunately do not remember the OS they had. But I can confirm their mobile version of Chrome rendered the same as the desktop rendition of the application. Same user/channel as well.

I realize now that my original post was confusing. Sorry for that.

I have a simple Phoenix based web application. It’s nothing specific to any client. The same application can be accessed via browsers on MacOS, Windows, mobile OS, etc.

The point I was trying to make is - when I open a web socket and a channel:

  • Windows (Chrome): Good
  • Linux (Chrome): Good
  • AndroidOS (version unknown, Chrome): Good
  • iOS: Doesn’t work

I was told that webrtc and iOS don’t play nice together - Hence my original point in the topic. I wondered if maybe that was the reason it wouldn’t work on iOS and work on other mediums without issue,

I was told that webrtc and iOS don’t play nice together

Are you actually using webrtc? I think you might be confusing it with websockets.

Phoenix channels can’t use webrtc as its transport, but they do use websockets by default. All browsers on iOS support websockets.

I was told that webrtc and iOS don’t play nice together - Hence my original point in the topic. I wondered if maybe that was the reason it wouldn’t work on iOS and work on other mediums without issue,

So, no. WebSockets work just fine in iOS browsers.


To better suggest why your iOS app fails to setup a channel, we might need to see some source code.

1 Like