Closed naren-mavshack closed 3 years ago
merhaba; kodlarınızı görebilirmiyim.
Hi,
I am using below code in my dart project.
class SignalRClient { static SignalRClient _client;
static SignalRClient getInstance() { if (_client == null) { client = SignalRClient.(); } return _client; }
SignalRClient._();
SignalR _signalR; String _signalRStatus;
Future
bool connected = await _signalR.connect();
print("Signal Connecting : $connected");
return connected; }
_onStatusChange(status) async { print("statusChangeCallback: " + status);
_signalRStatus = status;
if (status == "Connected") { await subscribedToChannel(methodName); await subscribedToChannel(event1); await subscribedToChannel(event2); await subscribedToChannel(channelDispatch); await subscribedToChannel(channel1); await subscribedToChannel(channel2); await subscribedToChannel(channelKey);
List arguments = [channelKey, channelDispatch]; var r = await _signalR.invokeMethod(methodName, arguments: arguments); print("Invoke $methodName: $arguments ==> $r");
arguments = [channelKey, channel2]; r = await _signalR.invokeMethod(methodName, arguments: arguments); print("Invoke $methodName: $arguments ==> $r");
arguments = [channelKey, channel1]; r = await _signalR.invokeMethod(methodName, arguments: arguments); print("Invoke $methodName: $arguments ==> $r"); } else if (status == "Reconnecting") { } else if (status == "Disconnected") {} }
_onNewMessage(message) { // if (event == 'web_booking') {} print("\n\n\n\nHurrey New Message received : \n$message\n\n"); }
Future
Future
_signalR.subscribeToHubMethod(channel);
print("SignalR Subscribed: $channel"); }
Future
On Sat, 16 Jan 2021 at 02:44, yenge35 notifications@github.com wrote:
merhaba; kodlarınızı görebilirmiyim.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AS-Devs/signalr_flutter/issues/20#issuecomment-761200527, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIZOKCMY4546UCW5UEZVSPTS2CV3HANCNFSM4WDYPJFQ .
-- Thanks & Regards [image: IPMovers IT Ptd. Ltd.] Narendra Vaishnav Tech. Lead | Mobile Plateform Tel: +91-7307817025 IPMovers IT Ptd. Ltd. http://ipmovers.com/ www.ipmovers.com http://ipmovers.com/en.html
6th Floor, STPI Building, C-184,Industrial Area, Phase-VIII A, Sector 75, SAS Nagar, Punjab 160071, India. https://goo.gl/maps/BjL31aTaNUo A part of the Mavshack Group https://www.mavshack.se/
Clients.All.methodName("Message")
sunucu tarafından böyle bir kod ile "methodName" tetiklenebilir.
await subscribedToChannel(methodName); await subscribedToChannel(event1); await subscribedToChannel(event2);
tırnak işareti içerisinde olacak
await subscribedToChannel("methodName"); await subscribedToChannel("event1"); await subscribedToChannel("event2");
Try using the latest version and let me know if the problem is still there. For me its working fine in simulator.
Due to time constraints we have implemented own native code , and I am not able to follow the same thread so I am closing this issue for the time. Thanks
Hi, Try to connect with iOS , it is now working it show connecting and then after it is Disconnected.
SignalR Connecting. Current Status: Optional("Connecting") Error: Optional(["message": Error during negotiation request.])
And in Android it is connected but does not listen channel messages , we try but hubCallback is never called