Skip to content

trackforce/react-native-grpc-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Native gRPC Starter

This is a starter template for gRPC and React Native. It contains backend (Golang) and mobile (React Native) folders.

How it works

  1. Protobuf.js is used for generating proto types and services. See here
  2. Communication with native is done by passing binary as base64 string (React Native doesn't support TypedArray).
  3. For iOS SwiftGrpc is used to actually make network calls. It uses low level SwiftGrpc API. See here.
  4. For android SwiftJava should be implemented the same way at some point. (PR is welcome).

Features

  • Protobuf.js support with Typescript.
  • Unary calls.
  • Unary middlewares.
  • Server, Client, Bidirectional streaming.
  • Low level native gRPC Swift implementation.
  • Low level native gRPC Java implementation.

Run

  1. Start gRPC backend
cd backend
make container
make start
  1. Start React Native app
cd mobile
yarn run-ios

alt text