Hacker News new | comments | show | ask | jobs | submit login
How I learned React Native in a weekend and shipped an app (vasir.net)
159 points by enoex1 on Apr 24, 2017 | hide | past | web | favorite | 32 comments



I have prior ios experience and was able to get the view side of React Native working without much problems, but once I started needing to store something on the device (especially trying to understand Redux and other similar solutions), I hit a pretty solid wall in my development and eventually put it on the backburner.

It looks like you might have been able to bypass this in your app, but if not, how did you approach that aspect of it?


In this app I did not have to worry about that, but I can recommend https://github.com/sunnylqm/react-native-storage for dealing with storing on the device if you want to manually do things. I haven't built an app with React Native yet that does rely on local storage; however, with Redux and the redux-storage library it should be no problem

I do very much like Redux, but definitely that whole data flow layer can be intimidating. Wes Bos has a great free course on react / redux ( https://learnredux.com/ ) that can help that learning process, and there is the excellent courses on https://reacttraining.com/ if you are willing to invest a little bit of money on learning.

With all that said, you don't _need_ to use Redux or anything else to work with storing data. It might be a good idea to try manually storing with the aforementioned storage library just so you can get something working and feel like you're making progress; and then spending some time with Redux and (https://github.com/michaelcontento/redux-storage provides support for storing data with react native). Good luck!


You probably don't need Redux if it's just simple persistence of data.

The simplest option is just to read and write a blob of JSON using the AsyncStorage API: https://facebook.github.io/react-native/docs/asyncstorage.ht...

Another option you could try is Realm, which is commercial but has a free tier (even for commercial apps) and has a pretty simple API: https://news.realm.io/news/introducing-realm-react-native/

Another is the SQLite module which comes with Expo:

Docs: https://docs.expo.io/versions/v16.0.0/sdk/sqlite.html Example: https://github.com/expo/sqlite-example/blob/master/main.js


Okay cool. Good to know that you don't need to use Redux in conjunction with AsyncStorage. I also like SQLite, so I'll investigate that as well.

It'd be really nice if I get away without Redux. It was the main pain point I had with it, everything else was fairly smooth.


Highly recommend realm, works like a charm and has migrations too.


I'm sure it works great, but I dislike adding too many layers to my apps. I've been burned too many times by companies that have stopped supporting and moved on to something else, or disappeared, or haven't kept up with the latest iOS changes, or whatever, and I'm forced to migrate to a different solution, to let myself use these for my personal projects, where I have very limited time and energy.

Even using React Native is more than I'd normally do, but I don't see a better cross-platform option right now.


Prior iOS development certainly helps a lot. From my experience, a lot of time were spent debugging on Xcode to build the app itself.


You mentioned you previously shipped iOS apps. How was the Android integration with React Native?

Is it easy for someone unfamiliar with Android dev environment to push to Play Store?


Yes, quite easy! I have very little android dev experience. Android integration was excellent, I had zero issues. It was easy to ship to the play store (faster and less painful than iOS. And if you need to modify something, you don't need to wait days to get it re-approved).

If you're playing "within the bounds" of what React Native provides, it's wonderful. If you're doing some fairly custom things you may need to drop down and write Native Modules ( https://facebook.github.io/react-native/docs/native-modules-... ), but the ecosystem is growing so fast that there are so many third party libraries that cover many of the custom things you'd want to do ( https://github.com/jondot/awesome-react-native )


thanks! this is really good news. I'm sort of in the same shoes as you. I work as an iOS developer and I wrote React for fun on the side.

Knowing how easy to is to ship to Android Studio is an added benefit.


Couple notes about the android app

   - the icon is broken, all I see is the green android face
   - when i log in to youtube, it says the log in is from an Iphone per my google security alert
   - the back and forward arrows don't look right.  They don't have the right icon to be a visual cue for back and forward.  They look more like previous and next.
   - would be great to handle full screen
   - video speed is not preserved when starting a new video.


Also it seems to require too many permissions for what is does.


From where React Native is headed it sounds like it is going to significantly devalue the experience of a lot of native iOS and Android developers.


This is why we need mobile devices that run a full operating system and full browser. Missing features and incompatibility make mobile useless in many real-world cases.

Why can't we just watch YouTube videos in Chrome on a mobile device?


> Why can't we just watch YouTube videos in Chrome on a mobile device?

Is this an issue on android? I can do this without problems on iOS (with both iOS Chrome-skinned Safari and regular Safari)


It really isn't a problem on android. YouTube works perfectly on android chrome, but chrome tends to open the YouTube app on android since it's installed by default.


Works fine on android. This app is just a webview anyway, so it is effectively the same thing.


Hopefully the app uses something less power-hungry than JS and a web browser to render the video. Ideally we wouldn't be using those for that task anywhere else either, but that battle's been lost.

Also: if they make you install an app they can track you better, and make it harder to block their ads/spying.


>Why can't we just watch YouTube videos in Chrome on a mobile device?

Because Google owns Youtube.

Google's primary business is online advertising.

Full-blown mobile browsers could have ad-blocking extensions, which Google does not want to happen on Youtube.

They purposefully attempt to stop people from being able to access Youtube on their phones outside of their official app.

There are restrictions on certain videos w.r.t. if it can be played on a phone or only on desktop - I don't know if this is licensing (music, etc) or what, but they care quite a lot about this.

They also have Youtube Red, which is a paid service that lets people play videos with their screens off, which you could theoretically bypass if you aren't using their app.


You can if you fiddle with default apps to open a given link. It seems like those can get deleted on certain updates or at least that's happened to me before.


I can watch YouTube in Firefox on Android, but I get a lot of dropped frames.


Doesn't happen to me, and I'm using a Galaxy S3.


What did you earn and how much mobile development did you previously do?


Do you think it's possible to monetize this to make it a full time gig?


Easy answer. No. Not for just this app.


I don't understand the purpose of the app, can someone explain?


He built an app that lets you change the playback speed of youtube videos on phones.


There's a whole section in the article explaining this in detail.


"I do experience with React, but none with React Native."

Oh


The header animation is terribly distracting and annoying. I though "let's follow the mouse pointer with something gimmicky" went out the door with geocities.


What's with the flickering header?


It's a voronoi + boids visualization that flocks around the mouse (and each other).

In honesty though, it's literally eye cancer ;P




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: