Code Monkey home page Code Monkey logo

Comments (5)

olofd avatar olofd commented on June 9, 2024

Don't know what you are doing wrong here. Did you get it working?

from react-native-signalr.

jp928 avatar jp928 commented on June 9, 2024

@joyceljy
Didn't see you have join group function.

from react-native-signalr.

daominhsangvn avatar daominhsangvn commented on June 9, 2024

@olofd I got the same issue,
From the C# backend, I'm using method Clients.Group(roomName).addMessage(...); to send message to a group.
From the React-Native, i invoke a method to join a group and listen callback addMessage.
The callback addMessage never fired even i triggered from the api while the browser is working.

If i run the app from the react-native command $ react-native run-ios, it's working perfectly
But when i try to run from xCode (Both Debug and Release), it's not working.

EDIT:
I found out when i turn the remote debug on, it will work. Otherwise, it wont

from react-native-signalr.

daominhsangvn avatar daominhsangvn commented on June 9, 2024

I managed to fixed this issue, please see my package
https://www.npmjs.com/package/%40nois%2Freact-native-signalr
Check example.js file in github for example code

from react-native-signalr.

sepidar902 avatar sepidar902 commented on June 9, 2024

Hi,
Im using Azure as server.

And my environment is as follows:
Client 1: Web browser with Signalr JS installed
Client 2: React-native app

Server:
Asp.net C# Server with Signalr

When a client invoke a message , people in the group will receive messages.
My web browser(Client1) received message successfully but my react-native app (Client2) didn't.

`
componentDidMount() {

    const connection = signalr.hubConnection('http://signalrpj.azurewebsites.net');
    connection.logging = true;

    const proxy = connection.createHubProxy('chatHub');

    proxy.on('addMessage', (message1) => {
        console.log('message-from-server Group', message1);
        if (message1 == 'openMindwavePage') {
            proxy.invoke('send', this.props.login_account, 'haveOpened');
            this.props.MindWave();
            connection.stop();
        }
    });


    connection.start().done(() => {
        proxy.invoke('group', 'this.props.login_account');
        console.log('Now connected, connection ID=' + connection.id);
    }).fail(() => {
        console.log('Failed');
    });

}`

Please help ,Thanks
Joyce
Duplicate of ##52 (comment)

from react-native-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.