jquery - socket.io connecting but not firing events on ios10 -
i'm using jquery/socket.io/nodejs. until ios 10 (ipad - not tested on iphone), used work , connection server. abstracted larger project, duplicate issue. nodejs server gets connection in example, seen in it's log file.
i don't have connection browser console, since it's ipad. using safari, though chrome not work also. tried putting "try/catch" around (not shown here) , "catch" never fires.
socket.io uses websockets, not ipv6 compatible, apple may have issue that, have not found definitive answers referencing that.
have read somewhere apple may cripple javascript uses "eval", again not find more definitive.
<html> <head> <title>ios10 socket.io test</title> <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' /> <meta http-equiv="content-security-policy" content="default-src 'self' data: gap: ws://dev.website.com:3002 http://dev.website.com ; style-src 'self' 'unsafe-inline' ; media-src * ;script-src 'self' 'unsafe-inline' ;connect-src 'self' *" /> <script src="lib/jquery-1.10.2.min.js" type="text/javascript"></script> <script src="lib/socket.io-1.4.5.js" type="text/javascript"></script> </head> <body style="margin:0;padding:0;"> <div id='debug' style="margin:12px;border:1px solid red;"></div> <script> $(document).ready(function() { var tt = this; tt.debugprint = function(s) { console.log(s); $("#debug").append(s + "<br>\n"); } tt.io = io; // grab global "io" var href = 'http://dev.website.com:3002'; tt.socket = tt.io.connect(href); if (tt.socket) tt.debugprint("socket created"); tt.socket.on('connected', function(data) { tt.debugprint("connected"); }); tt.socket.on('disconnect', function(data) { tt.debugprint("disconnected"); }); tt.socket.on('reconnecting', function(data) { tt.debugprint("reconnecting"); console.error(data); }); tt.socket.on('reconnect', function(data) { tt.debugprint("reconnect"); console.error(data); }); }); </script> </body> </html>
Comments
Post a Comment