Showing results for 
Search instead for 
Did you mean: 

How to build mobile app homepage with default API ?

How to build mobile app homepage with default API ?

We are working to build our Mobile app with M2 and we found the default APIs from Magento 2.2 very useful and we did not need to build any custom APIs until now. 


Now we are working on the mobile app homepage, its has different sections such as: (Top Banner, Best Seller, Featured products, New products, top categories, etc) see our app homepage


We would like to control all these homepage sections manually.

What is the best way to manage and setup the homepage with APIs? 


We looked at CMS Blocks which in my opinion is perfect for this task especially that there is complete endpoints for Blocks BUT the only problem with blocks when we call the API endpoint it returns HTML content which is not predictable and it changes if the theme of our store change. 


So Now I am looking at creating a new root category name is "Mobile" and create different sub-categories such as Top sellers, Trending, New etc. 


Is there a better best practice way to do this without getting into building custom APIs? 


Also even if I would build custom APIs what if I wanted to change the position of the sections or disable a section to not appear on my app homepage. 


Appreciate any thoughts or previous experiences  



Re: How to build mobile app homepage with default API ?

@ibrahimmmYou may not be able to use default API's for everything. You would have to come up with some custom API as per the requirement of your home page.


Rest all is depend on how much time and money you want to spend on your app. More control you need more updates need to be made at Magento as well as in app.


My 2 cents would be to have configuration for all those settings in the Magento and handle them in the App. So in future if you want to hide or change the position then it can be controlled within the Magento and as soon as cache refreshes in the app will have updated design.


Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

Magento 2 Certified Solution Specialist (x2). Follow me on Twitter