Files
Paulo BarrosandJonny Reeves c3c8fe799b [Transport] React Native support - Adds and exposes ReactNativeTransport. (#458)
* Adds and exposes ArrayBufferXhrTransport.

* Indentation fix.

* Create separate package for ArrayBufferXhrTransport.

* Integration test configuration for ArrayBufferXhr.

* Adds Dockerfile to run integration tests.

* Add CMD to Dockerfile.

* Revert xhr.ts

* Removes Dockerfile.

* Renames transport.

* Code review feedback.
2019-11-02 09:06:33 +00:00

854 B

@improbable-eng/grpc-web-react-native-transport

Transport for use with @improbable-eng/grpc-web that works with React Native.

Usage

When making a gRPC request, specify this transport:

import { grpc } from '@improbable-eng/grpc-web';
import { ReactNativeTransport } from '@improbable-eng/grpc-web-react-native-transport';

grpc.invoke(MyService.DoQuery, {
  host: "https://example.com",
  transport: ReactNativeTransport(),
  /* ... */
})

Alternatively specify the Default Transport when your server/application bootstraps:

import { grpc } from '@improbable-eng/grpc-web';
import { ReactNativeTransport } from '@improbable-eng/grpc-web-react-native-transport';

// Do this first, before you make any grpc requests!
grpc.setDefaultTransport(ReactNativeTransport());