I'm Android Developer and I Used Signal R for communication with Server and get data when emitting from server:
hubConnection.on(
Constants.SIGNALR_TARGET_RECEIVE_CALL_REQUEST,
{ receiveCallRequestDetails, isVideoEnable ->
intent.putExtra(BROADCAST_SIGNAL_R_RECEIVE_CALL_REQUEST_DETAILS, receiveCallRequestDetails)
intent.putExtra(BROADCAST_SIGNAL_R_RECEIVE_CALL_REQUEST_IS_VIDEO, isVideoEnable)
LocalBroadcastManager.getInstance(applicationContext).sendBroadcast(intent)
// applicationContext.sendBroadcast(intent)
},
ReceiveCallRequest::class.java,
Boolean::class.java
)
when I get Boolean from the server(isVideoEnable is Boolean) and pass it to BroadcastReceiver I got RunTimeError with this description:
HubConnection disconnected with WebSocket connection stopping with code null and reason 'Cannot cast java.lang.Boolean to boolean'.
It normally should be able to but you could change it from Boolean (object type) to boolean (primitive type).