java - How to add user to SignalR Group in Android -
i wanna add user signalr group says failed. android code add user in group below
hubconnection connection = new hubconnection("http://www.planetskool.in/"); hubproxy proxy = connection.createhubproxy("chathub"); try { //log.d(tag, "connection.start()..."); signalrfuture<void> awaitconnection = connection.start(); // log.d(tag, "started"); awaitconnection.get(); // log.d(tag, "got"); } catch (interruptedexception e) { /// log.e(tag,"interruptedexception"); e.printstacktrace(); } catch (executionexception e) { //log.e(tag, "executionexception"); e.printstacktrace(); } signalrfuture<void> isgroupcreated2 = proxy.invoke("joingroup", loginuserinfoid); log.d("isgroupcreated", "isgroupcreated2 = " + proxy.invoke("joingroup", loginuserinfoid).isdone()); proxy.on("broadcastmessage", new subscriptionhandler1<string>() { @override public void run(final string status) { //getapplicationcontext().runonuithread(new runnable() { //public void run() { log.d("signalrresult=", status); if(status.touppercase().equals("false".touppercase())) { new syncmessagefromserver().execute(); } else { new syncgroupmessagefromserver().execute(); } // } //}); } } , string.class);
and code in chathub in mvc web application is
public task joingroup(string groupname) { return groups.add(context.connectionid, groupname); } public void sendall(string ruid, string message) { clients.group(ruid).broadcastmessage(message); }
how can make work send notification particular user
Comments
Post a Comment