Ionic Socket.io Build on android giving Transport Pollings Issue -
i building game on ionic using socket.io communicating plays between clients. have tried connecting express server running on local host same 1 on digital ocean:
var express = require('express'); var app = express(); var socketio = require('socket.io'); var server = app.listen(8080); var io = require('socket.io').listen(server); io.sockets.on('connect', function(socket) { });
it works fantastic ionic serve, , when emulate on ios, howerver, when run or emulate on android can't connect, giving me following errors:
failed load resource: server responded status of 404 (not found) http:// server /socket.io/?eio=3&transport=polling&t=1434658858975-0 failed load resource: server responded status of 404 (not found) http:// server /socket.io/?eio=3&transport=polling&t=1434658860600-1 failed load resource: server responded status of 404 (not found) http:// server /socket.io/?eio=3&transport=polling&t=1434658862535-2
i connecting through factory
.factory('socket', function($rootscope) { var socket = io.connect( server ); return { on: function (eventname, callback) { socket.on(eventname, function () { var args = arguments; $rootscope.$apply(function () { callback.apply(socket, args); }); }); }, emit: function (eventname, data, callback) { socket.emit(eventname, data, function () { var args = arguments; $rootscope.$apply(function () { if (callback) { callback.apply(socket, args); } }); }) } }; });
i blank on this. there setting somewhere that, if changed, allow me connect?
you try building in meteorjs node/express based app framework uses socket.io has ionic package (full support) , cordova support built in oauth well. i've built few mobile apps , it's stack. check meteorjs.com , packages @ atmosphere.com
Comments
Post a Comment