6 essential libraries to use on your next React Native app. A library to manage dynamic updates to React Native apps. Application mobile Cordova avec Meteor. Application mobile Cordova avec Meteor Cet article fait suite à l’article Meteor, pour un développement plus rapide qu’une fusée. J’ai décidé de m’attaquer à la partie mobile proposée par le framework. Il est en effet possible depuis la version 1.0 de créer des applications via Cordova. Je vous propose d’adapter l’application JoliSnap réalisée dans mon article précédent. Pour ajouter le support du mobile, il suffit de trois commandes $ meteor add-platform ios $ meteor add-platform android Puis lancer l’application avec la commande $ meteor run ios On voit que l’adaptation responsive fonctionne mais n’est pas prévue pour cette taille d’écran (scrollbar horizontale). Nous allons donc améliorer notre application en utilisant le framework CSS Ionic et Cordova pour créer une application mobile hybride.
Architecture J’ai préféré éviter la création d’une nouvelle application pour la version mobile, afin de garder le maximum de code entre la version desktop et mobile. Prendre des photos Interface Debug. Easily Connect React Native to a Meteor Server. With Parse recently announcing that they will be shutting down, many companies are looking into the next steps to take. This shut down may lead many away from BaaS products and towards an in-house backend - such as Meteor. Let's walk through what it's like to connect a React Native app to a Meteor app (serving as the backend). This tutorial assumes you already have React Native and Meteor installed and working on your system.
You can access the finished app (Meteor and React Native) on Github. Create the Meteor App meteor create meteor-app Then we're going to remove autopublish and insecure, generally a best practice. cd meteor-app && meteor remove autopublish insecure And add the Random package. meteor add random We're also going to change the file structure up a bit. Then add the following files (and folders): /both/posts.js/client/home.html/client/home.js/client/index.html/server/app.js We'll go over what goes into each of those files in a moment. Add Functionality to the Meteor App. GitHub - meteor-factory/react-native-tinder-swipe-cards: Tinder-like swipe cards for your React Native app.
GitHub - PaulBGD/react-native-image-slider: A quick and easy image slider for react native. Google OAuth using Meteor and React Native. Allowing a user to sign up for your app via OAuth has become common place. If you've used Meteor in the past you've experienced the ease through which you can set up OAuth in the browser or in Cordova. If you haven't, or you're just interested in learning more about the flexibility, I would suggest checking out this recipe by The Meteor Chef. It may also help you configure Google OAuth if you run into any issues throughout this post. One problem with the way Meteor handles the integrated OAuth is its reliance on the browser. This one took me a while to workout but I think I've now find a solution I'm happy with - which we'll be exploring today.
So, let's jump into how to set up Google OAuth for your React Native application that is backed by Meteor. First, clone the Meteor React Native boilerplate. Git clone Setting up the Google App Setting up the Meteor Server Now create a .gitignore file in the MeteorApp directory. How to Debug Exceptions with React Native. So you took the plunge. You decided to try out React Native. So did I, and it’s awesome. But as with all brand new shiny things, there are some rough edges. React Native has an impressive set of developer tools. Pressing CMD+D on iOS will bring up the developer menu, you can then enable React Native debugging. Select “Debug in Chrome.” After finishing this quick setup you’re good to go. Ignore “Pause on Caught Exceptions” at your own peril. You can now open your console and debug like a pro. Until you throw an asynchronous exception. React Native dev tools work like magic In React Native exceptions are generally handled very well.
When I try to `subscribe` I get an error of `INVALID_STATE_ERR`, what does this mean? This error means you're trying to interact with the DDP/Meteor server before you've actually connected to the server. How can I identify a user? If you've authenticated your user via DDP then you'll have access to this.userId in publish functions and Meteor.userId() everywhere else. Can I do Hot Code Push? Yes! If you want to get CodePush integrated check out this article. Which DDP Package should I use? What about Minimongo? React Native Navigator — Navigating Like A Pro in React Native. React Native Navigator — Navigating Like A Pro in React Native There is a lot you can do with the React Native Navigator. Here, I will try to go over a few examples of what you can do with the Navigator and explain how it all works in depth.
In React Native you have two choices as of now for Navigation (only one cross platform) out of the box, as well as the ExNavigator from Exponent. We will focus on the main Navigator component as that is what most questions I have seen pop up are about, and is the cross platform navigator option. We will not talk about NavigatorIOS as it is not currently maintained by the main react native project and is only available for use on iOS.
</Text><Text> You just use native components like 'View' and 'Text', instead of web components like 'div' and 'span'. </Text></View> ); }} A React Native app is a real mobile app With React Native, you don't build a “mobile web app”, an “HTML5 app”, or a “hybrid app”. Don't waste time recompiling React Native lets you build your app faster. Use native code when you need to React Native combines smoothly with components written in Objective-C, Java, or Swift. React Native’s LayoutAnimation is Awesome. React Native’s LayoutAnimation is Awesome If you are developing with ReactNative and have not tried LayoutAnimation yet, you are missing out. Coming to ReactNative as an iOS developer, I was worried about losing the convenience of CoreAnimation. UIView animations are so nice; set the desired view properties and go. ReactNative’s Animated API works similarly, but requires a state property for each desired animation.
For complex views this gets messy fast. Enter LayoutAnimation. For n number of layout changes in your view, one line does it all. In this example, I have a complex view with three possible states. The state changing code without any animation is below. Now, lets spice it up by adding a fancy LayoutAnimation. LayoutAnimation.configureNext(LayoutAnimation.Presets.spring); This will apply the `spring`animation preset to any layout changes that occur during the next render cycle. BAM. Note: LayoutAnimation works for Create and Update layout events. EaseInEaseOutlinearspring. Siphon | Build and publish React Native apps without installing Xcode. Testing React Native Apps on Android and iOS. Dear Testdroiders, It was roughly a year ago when Facebook announced their intention to open source the React Native framework for building native apps. This wasn’t a big surprise considering their own experiences with the HTML5 based application which got lots of negative feedback.
Moving to native was clearly the right move and as they had some good and popular implementation for writing web apps (with React) there was a need to bridge the gap between the native and web/hybrid apps. With this combo, writing native apps for mobile platforms (Android and iOS) is actually very easy and it seems to work well across different setups. But, how to test – and automate the testing of these sort of apps? Originally, Facebook created the React framework for its own engineering team that could use it to build user interfaces for all three platforms – Android, iOS and web – using exactly the same code. No question, mobile app development is definitely more challenging than building web stuff. Updating the React Native Meteor Boilerplate. Updating the React Native Meteor Boilerplate A few months ago I released a boilerplate to build React Native apps with Meteor.
A lot has changed on this landscape in the last 3 months and that boilerplate has fallen behind. It was extremely simple and used the best practices at the time — it was based off of how I was actually building React Native Meteor apps at that time. We’ve now got react-native-meteor which gives us all of the same DDP capabilities (and then some) with a very Meteor like API (the goal is to follow it as closely as possible). This is now what I’m using to build apps and I was no longer recommending my boilerplate because it was no longer how I would suggest building a React Native Meteor app. So, rather than put together a tutorial this week, I decided to take some time to think about the boilerplate and update it so it reflects the way I actually build React Native Meteor apps. Much of that structure is taken from real apps — not just demo stuff.
Why Native Starter Pro, why not Ionic Framework? Why Native Starter Pro, why not Ionic Framework? When I started out with mobile app development, it was fairly easy with Ionic using web technologies without the knowledge of Java for Android and Objective-C (Swift) for iOS. But in due time what bothered me was that the layer of WebView made it somewhat slow which affected the overall performance of the app. The very aim to develop a good app is that at the end we get smooth running product, user friendly and negligible performance issue. This is the reason I thought of trying out React Native.