Kin React Native Starter
This will get your React Native app Kin enabled in a few minutes. All you need to do is add a simple class file to your app, and you should be able to make calls to Kin’s blockchain immediately.
Make sure you have read Getting Started and have the required environment variables
Install the Kin SDK for React Native to your project:
yarn add @kin-sdk/react-native
# Or if you are using npm
npm install @kin-sdk/react-native
Add the KinService.ts class to your app
Import and instantiate a new KinService.
Instantiation requires several variables from the getting started section:
const kinService = new KinService(KinEnvironment.Test);
See App.tsx for instantiation and sample calls
Note on Webhooks
Any transactions made by the device will alert your server with a webhook. (see server tutorials). Your server will receive a notification of the transaction, including
MyPass credentials above. The credentials help your server track transactions from specific users.
However, you can safely test your device code without turning on your webhooks.
A demo App is included that you can run and test. To use the app:
Pull https://github.com/kintegrate/kin-starter-react-native into a local folder
/kin-starter-react-nativefolder on your local.
Install the dependencies
cd ios && pod install
Start Android app
Start iOS app
To fund the demo app or any address in Kin’s
TEST blockchain, simply copy its address and paste it to Kin drops:
The service will send it 10 Kin in the test network. You can refresh this as often as you like to add more Kin to your app.