How can we implement SignalR in Ionic App?

独自空忆成欢 提交于 2019-12-11 12:12:13

问题


I have made an app that sents messages to the users who have registered with the app(Ionic/Angular). It is getting all messages from database (SQL Server/C# API) and printing out on the message box which is good but when we are sending message to someone whom we are talking, the person is not getting message without refreshing page. For that purpose I have to use SignalR, so I need to know something in this regard that How can I implement SIgnalR with my project?

I have gone through so many tutorials but I am not getting the actual results. Below is my Ionic/Angular page to display my SQL Server messages to the app.

  <div>
    <ng-container *ngIf="this.authService.allMessage">
      <p *ngFor=" let data of this.authService.allMessage">
        {{data.sendersName}}: {{data.message}}
      </p>
    </ng-container>
  </div>

Now what I really want is to display messages instantly between two users. As, whenever I sent a message to someone who has already opened a message chat box with me, gets message instantly without refreshing the page.

来源:https://stackoverflow.com/questions/55449492/how-can-we-implement-signalr-in-ionic-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!