Code Monkey home page Code Monkey logo

Comments (5)

d668 avatar d668 commented on June 13, 2024 1

so does SignalR work well with Cordova Android/iOS ? Connection is not lost when device is switched off?

from signalr.

remcoros avatar remcoros commented on June 13, 2024

I found out what is going on.

The $.connection.hub.url is a relative url. And because the html file which references the 'signalr/hubs' javascript is a resource in the android app, it tries to $.post to 'signalr/negotiate' relative to the html file (instead of relative to the hubs script url). If you get what I mean.

I fixed it by manually setting $.connection.hub.url to the absolute url of the web application (http://.....).

Maybe it is an idea to determine the server name from the script reference and prefix the {service_url} with it.

'weinre' (remote javascript debugger) works like this. It determines it's remote url based on the url of the script reference in the html.

Is that a good idea? I will have a look at this too.

from signalr.

remcoros avatar remcoros commented on June 13, 2024

Sent a pull request for this

from signalr.

hainahoo avatar hainahoo commented on June 13, 2024

Hi remcoros,
whether the SignalR is working even the phonegap app in suspended (inactive) status?

from signalr.

mohsinali1317 avatar mohsinali1317 commented on June 13, 2024

So if my server lies at www.xyz.com, then what will be the absolute url?

var connString = "://www.xyz.com/connection";

from signalr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.