How Can I Incorporate my WordPress Blogs into an iOS app?

前端 未结 2 1880
-上瘾入骨i
-上瘾入骨i 2020-12-23 18:31

How Can I Incorporate my WordPress Blogs into an iOS app? I have a beautiful word press site and I want to create a native iOS app. I have knowledge of coding for iOS, but I

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 18:59

    You can read an answer of mine about cloud based ios apps (the db is online) here: press me

    now as i said, to get info from the server you need to use JSON, in wordpress there is a very good and simple plugin for that: JSON API

    now the use of that is simple, you can see it in the notes: http://wordpress.org/plugins/json-api/other_notes/

    but for example for getting the last posts in the system you need to run the url: http://www.example.org/api/get_recent_posts/

    The /api means it's the plugin (you can change that in the settings) and the /get_recent_posts/ is the function.

    there are many other functions like this one for everything you need and it can get more complicated than that based on what you want to get from the db.

    After running the "query" and getting a response in JSON you need to use it: Working with JSON in iOS 5 Tutorial
    now for the running of the url i recommend to use AFNetworking

    now all you need to do is use the json string you get for getting out info. this would have some more issues like managing html codes you get in the content respons and so but it's the start, develop your way up :)

提交回复
热议问题