With the launch of WordPress 4.7.1, that includes built-in support for its REST API, WordPress became the most suitable option for those who are looking into launching their own native mobile apps quickly and cheaply
WordPress can work as an excellent back-end platform for your next native app, especially if it is content-driven or an online shop.
It’s 2011, and we see the beginning of hybrid mobile app development. Frameworks like Apache Cordova, PhoneGap, and Ionic Framework slowly emerge. Everything looks good, and web developers are eagerly coding away mobile apps with their existing knowledge.
However, mobile apps still looked like mobile versions of websites. No native designs like Android’s material design or iOS’s flat look. Navigation worked similar to the web and transitions were not buttery smooth. Users were not satisfied with apps built using the hybrid approach and dreamt of the native experience.
Furthermore, changes done to the code during development are loaded onto the testing devices almost instantly! This used to take several minutes when we had native development through other approaches. Developers are able to enjoy the instant feedback they used to love with web development.
React developers are more than happy to be able to use existing patterns they have followed into a new platform altogether. In fact, they are targeting two more platforms with what they already know very well.
The WordPress REST API
In late 2016, WordPress released the much awaited REST API to its core, and opened the doors for solutions with decoupled backends.
So, if you already have a WordPress and WooCommerce website and wish to retain exactly the same offerings and user profiles across your website and native app, may that solution can exactly fit you!
Representational State Transfer, or REST, provides standards that web systems can use to interface with each other. Without REST, two systems wouldn’t be able to understand each other and so send data back and forth.
For an application to be RESTful, it must conform to five principles:
- Uniform interface. The URLs used to access resources in the system have to be uniform, consistent, and accessible via a common approach such as GET (more of which shortly).
- Client-server. Client applications and server applications must be separate, so they can be developed independently of each other. If the server-side technology (i.e. WordPress) changes, the server-side application (an app, for example) must still be able to access it via the same simple method.
- Stateless. The server doesn’t change state when a new request is made using the API. It doesn’t store the requests that have been made.
- Cacheable. All resources must be cacheable, to improve speed and conformance to web standards. Caching can be implemented on the server or client-side.
- Layered system. A RESTful system lets you use multiple layers to access it, storing data in intermediate servers if it needs to. The server can’t tell if the final client is directly connected to it.
All of these constraints relate to web pages and applications and govern the way an application can interface with the API.
WordPress can accommodate a wide variety of native mobile apps
60% of the websites are built on top of WordPress. This essentially means that WordPress can accommodate 60% of all the business needs in the Internet industry. If this holds true for websites, it most likely holds true for native mobile apps as well. The likelihood that WordPress will be a good fit for your app idea is really high.
The power of WordPress comes from the large variety of plugins. You can turn your WordPress site into pretty much any business case you want by installing appropriate plugins and themes. WordPress is being used for news reading, shopping/e-commerce websites, travel websites, event websites, etc. And all of this is possible through the flexibility provided by the WordPress plugins. Those plugins and themes are so powerful that you can use WordPress for any mobile app idea you might have.
The more people are familiar with WordPress, the better the platform gets. Right now, WordPress is still in early stages when it comes to its capability of supporting native mobile apps, but given the widespread of developers working with WordPress on a daily basis, things are definitely heading in the right direction.
Additionally, the future of WordPress as a backend platform for native mobile apps looks really promising, after the decision of introducing the REST API plugin as part of the official WordPress release. This is proof that its creators are open to this new use case and are willing to invest into this direction as well. In this manner, the community is basically encouraged to pursue this approach, so many more awesome features will most likely follow soon.