subscribeToHubMethod method
- @Deprecated("This method no longer works on iOS. For now it may work on Android but this will be removed later. Consider using constructor parameter [hubMethods]")
- String methodName
Subscribe to a Hub method. Every subsequent message from server gets called on hubCallback.
Implementation
@Deprecated(
"This method no longer works on iOS. For now it may work on Android but this will be removed later. Consider using constructor parameter [hubMethods]")
/// Subscribe to a Hub method. Every subsequent message from server gets called on [hubCallback].
void subscribeToHubMethod(String methodName) async {
try {
await _channel.invokeMethod("listenToHubMethod", methodName);
} on PlatformException catch (ex) {
print("Platform Error: ${ex.message}");
return Future.error(ex.message!);
} on Exception catch (ex) {
print("Error: ${ex.toString()}");
return Future.error(ex.toString());
}
}