Build Data Driven iOS & Android Apps With WordPress REST API & NativeScript – Part 1

The WP Crowd
Published: July 25, 2016

Find Part 2 of this series here.
And Part 3 here.

If you have ever wanted to dive into building mobile apps, now is a fantastic time to do so.  There are so many tools out there that make it far easier than it was 5, hell not even 2 years ago.  I needed to build one for my company and decided on NativeScript {N} as my framework of choice.

I’m going to do a three part blog post covering the what, why and how to get started with NativeScript & the WordPress API to build data driven apps, on both platforms, at the same time.  If you are wanting to dive right in to NativeScript feel free to check out my blog and tidbits on it.

NativeScript

NativeScript, henceforth referred to as {N}, is a killer open source project that is fairly new and growing.  According to this google trends chart it has really started taking off over the past year.

google-trends-nativescript

It allows you to code in JavaScript or TypeScript in combination with good ol’ fashion XML and CSS to create native applications for both popular mobile OS’s with Windows Mobile on the way.  The community is fairly small but very active in their slack channel and Twitter.

Tying This Into WordPress

Databases are pretty clunky and tough to manage on {N} at this point.  They work fine, they work like normal databases.  Setting them up and managing data gets tricky though.

If you are wanting to manage your data in an easier way and/or have a web interface too, the REST API is your friend.

{N} has a very awesome library of plugins in Node.js.  One of the most awesome, bestest ever is nativescript-background-http.  I’ve written about using it to upload images to a php script, but we’ll get more into that later.

It also has Fetch API methods built in for standard POST calls and responses making it super easy to build out REST API integration with your website.

Platform Requirements

Building for Android and iOS at the same time doesn’t technically require a mac but technically it does.  You can program for both at the same time but you can’t emulate for iOS or build for iOS without Xcode.  And on a mac you can emulate Android as well so you get the best of both worlds.

That said, I’m going to try and keep these tutorials platform agnostic! When there is something that is specific to one or the other I’ll be sure to point it out.

Summary

So sit back, relax, I’m heading to Montreal for a WordCamp but I plan on pushing the next two blogs in this series over the course of two weeks.  Til then, see if you can get NativeScript setup on your machine and run through a basic tutorial (the first one they have is called groceries and it’s a great jumping off point).  If you have questions you can always reach out to me @ChrisFlanny.

Find Part 2 of this series here.

Get the latest from The WP Crowd

Leave a Reply

8 Comments on "Build Data Driven iOS & Android Apps With WordPress REST API & NativeScript – Part 1"

avatar
Sort by:   newest | oldest
trackback

[…] Build Data Driven iOS & Android Apps With WordPress REST API & NativeScript – Part 1 […]

Erwin
Guest

Hi Chris,

I’m very curious about what you are gonna tell. I’m a longtime enthousiast for wordpress. Past schoolyear I’ve created an app with phonegap for my students. Now I’m having vacation, I was thinking it’s time kick in wordpress as source for a app, web app or native. First I found an article from your colleague Josh Pollock, then I came across an tutorial from Roy Sivan, using Angular. Angular looks actually great to me. Now I saw this article, written today, I’m very interested and confused, hope you can get met me on right track with your article.

Erwin

trackback

[…] And if you missed Part 1 find it here. […]

trackback

[…] sure you have read Part 1 – An Introduction before proceeding as we are about to dive right into the action.  In this post we will get our […]

trackback

[…] sure to check out Part 1 and Part 2 of the series to get caught up on integrating the WP REST API into NativeScript […]

wpDiscuz