How does react-native-blockstack work?

#1

How can I connect react-native-blockstack with my web app? Without using WevView?

#2

They have this repo https://github.com/blockstack/blockstack-react-native

But I cannot get it working using expo 0.60

#3

Please provide more details if you have trouble.

The SDK is based on the iOS and Android SDKs.

#4

I got it working for android!

I ended up ditching expo and just used the react native cli as documented here: https://facebook.github.io/react-native/docs/getting-started (switch tabs to ‘React Native CLI quickstart’)

Then I had to tweak a few things after cloning the git repo.

First you have to create a debug.keystore as documented here - https://gist.github.com/henriquemenezes/70feb8fff20a19a65346e48786bedb8f:

  1. cd example/android/keystores
  2. keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"

Next you need to create a debug android manifest

  1. cd example/android/app/src
  2. mkdir debug
  3. cd debug
  4. create a file called AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
    <application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
</manifest>

Make sure you install dependencies npm install

To run the app on an android device or emulator make sure you run two terminal windows. One for the metro server and one for your app:

  1. In terminal 1
    react-native start
  2. In terminal 2
    react-native run-android

I have not tested for iOS yet, im sure there are things you need to do to get it working

#5

@nicktee can you get it work on IOS?

#6

it’s on my todo list! i should be able to look into it in the next week or two