Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@krishnafkh/react-native-grpc",
"version": "1.0.5",
"version": "1.0.6",
"description": "gRPC for react-native",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
18 changes: 18 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ export class GrpcClient {
Grpc.setResponseSizeLimit(limitInBytes);
}

/**
* initiating the grpc channel from JS layer
* */
initGrpcChannel() {
Grpc.initGrpcChannel();
}
Expand All @@ -208,20 +211,35 @@ export class GrpcClient {
Grpc.setKeepAlive(enable, keepAliveTime, keepAliveTimeOut);
}

/**
* only applicable for android
* @param message -> debug message
* */
resetConnection(message: string): void {
if (!this.isAndroid()) return;
Grpc.resetConnection(message);
}

/**
* only applicable for android
* @param enable -> show debug log in ui
* */
setUiLogEnabled(enable: boolean): void {
if (!this.isAndroid()) return;
Grpc.setUiLogEnabled(enable);
}

/**
* only applicable for android , to reset connection based on manage-channel state
* */
onConnectionStateChange(): void {
if (!this.isAndroid()) return;
Grpc.onConnectionStateChange();
}

/**
* only applicable for android , to set manage-channel to idle state
* */
enterIdle(): void {
if (!this.isAndroid()) return;
Grpc.enterIdle();
Expand Down