I have a database backed web application running which I would like to create a basic mobile app for. I am looking for advice on how best to do this. Currently I am looking at starting with an Android app, which connects to my web server and offers a cut down version of what a user can currently do on the website. For this I would obviously like to re-use as much of my controller code as possible, and looking around online it appears that I need to implement the yii-restful extension. Does anyone else have experience in this area who could point me towards some online resources/tutorials etc.?
Hi, you will have to have REST API (any API). In my case (I’ve three mobile platforms connected to the web API (win, android and ios)) I have three separated routes, one route is for the web app, the second one is for the mobile and 3rd is for mobile too but with authorization. What I mean is below:
These routes deteremine which controller I should actually run. Of course I use the same models for each controller. The main change is that controllers for mobile API extend ActiveController as described here http://www.yiiframework.com/doc-2.0/guide-rest-quick-start.html + some extra methods for authorization by headers.