The community forums are in BETA and closed to the public.

Receive response 404 on iOS through WebSocket

I was trying a simple example. WebSocket on iOS failed to connect to certain link, while it's working on web browser.

// only working on browser. iOS throw error code 404 NSString *urlString = @"wss://";

Someone suggest it's certificate problem. What's the reason it fails only on iOS? How to fix it?

Our javascript SDK has a wrapper which allows for usage of the websocket syntax. Which is why you think it works on the browser. But we don't maintain a websocket gateway.

For iOS your best bet is to use the latest official SDK.

The New! PubNub iOS SDK 4.0

Visit the developers page iOS SDK V4 for Realtime Apps. This SDK supports the latests connection capabilities from Apple and PubNub for better performing user communication and realtime apps.

Hi Massin,

I was using WebSocket js directly (not PubNub js SDK). On browser, I could connect to that link without any problems.

Since the problem happened iOS WebSocket, someone suggest that it might be certificate issue. I will try PubNub iOS SDK for sure. It's still worth to figure out this problem.

Login or Signup to post a comment