Appery.io and Wordpress

I´m trying to do an simple Wordpress-App for my Homepage.

I started using Appery.io, which is actually a good environment for a non-programmer.

But I wonder if anybody has experiences in hooking up a Wordpress Site to an App by Appery? Where would I start?

What my basic needs are:

1) Read the Articles 2) Comment on Articles directly in-App 3) Push-Notification about new article/comment

Topic outside-wordpress plugins Wordpress

Category Web


If you're using Wordpress 4.6, you can use the REST API without the need for the plugin by simply using the following:

add_action('rest_api_init', function() {

    $namespace = 'myapi';

    register_rest_route($namespace, '/myroute', array(
        'methods' => 'GET',
        'callback' => 'handle_my_route'
    ), true);

    function handle_my_route() {
        return 'Hello World!';
    }
}

Then, going to: yourwebsite/wp-json/myapi/myroute would return the callback value, which in the case above is 'Hello World'.


I got it done!

The key to all of it is to use a Plugin like "JSON API" in your Wordprss Installation to get your posts/etc.

For example you can later type www.example.com/json?get_posts

With the generated link you can go to appery and connect it as a REST API Service.

Haven´t tried all the functionalities yet, but i believe this is the way to go.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.