React-Native ios sign in help


#1

Hi, my team and I are interested in building a Blockstack react native app with ios support. I’m having trouble getting the sign in to work.

I am referencing the react native example https://github.com/blockstack/blockstack-react-native/tree/develop/example-react-native

But the onPress for sign in returns null… I’m I missing something?

Are there any working examples we can reference? Thank you so much in advance!


#2

@kayemcmc.id.blocksta Have you tried our IOS getting started? It starts with the Blockstack React generator.


#3

@moxiegirl this is brilliant I had not seen it! Thank you so much will give it a try and loop back! Thank you again!!!


#4

@moxiegirl so the idea is to build the app with react and then build a swift app that runs the react app, but not use react-native, does that sound right?


#5

Yep. You want to build an iOS app with react-native, right?


#6

@shreyas thats right, we were thinking of using react-native, but open to other suggestions that maybe have tried and tested with blockstack and ios.


#7

Sorry for the delay, I was travelling :). The best route would be a native Swift app. That react-native example is for Android, I believe. I’m working on an iOS version.

Are you on our slack? We can pair on this issue together, if you’re still seeing it.


#8

@shreyas thanks so much for getting back to me! We have decided to build a Swift native app, and when we are finished we will probably loop back and create an android app with react-native! I’m not on slack yet, but will def reach out to you if we run into any hurdles!!!
Thanks again!


#9

Awesome let me know if you get stuck anywhere!


#10

@shreyas I was able to get the ios cocoapod installed and running it took getting up to date with swift, but what I’m seeing from the tutorial, is that it’s basically redirecting to a browser app, we are attempting to create an app that will use the phone’s camera and local storage, is it possible to not redirect to a browser app and use a mobile app functionality instead? Thank you again for all your help and guidance!


#11

@kayemcmc.id.blocksta If you are referring to the hello blockstack web app then this is only used for login identification and the redirect page. In Blockstack, each app needs to host an app manifest on a public domain (or localhost for development). Then your native iOS (or Android) app can do all the work (camera, storage, etc…) natively.


#12

@kayemcmc.id.blocksta Friedger’s response is spot on. There is currently no way to authenticate without having a redirect page on the web. I recommend using Netlify to get something set up super quickly: https://www.netlify.com/


#13

thank you @friedger and @shreyas! Will give it a go based on your suggestion! Thanks again!


#14

Sure. You can clone and deploy Blockstack-webapp via Netlify. Just make sure replace myblockstackapp:// in /public/redirect.html to whatever value is registered for your app in its Info.plist.