doukong1391 2015-01-18 13:42
浏览 61

如何使用Slim Framework从移动应用程序(iPhone和Android)上的PHPFox网站访问现有API?

I've one website built in PHPFox. The website is functioning properly. Now the mobile apps for iPhone and Android smartphone are under development which will use the same database that PHPFox website is using.

So, I want to make the existing APIs that are used for a PHPFox website available to the mobile apps (both iPhone and Android) as well. I don't want to reinvent the wheel again and want to re-use the same existing code for mobile apps.

I did a lot of research about this. I've spent almost four days on the research. I didn't get a single link which will explain me how to access the existing APIs from a PHPFox website for mobile apps (iPhone and Android).

One option I found from my research is creating new RESTful webservices using PHP or implement any such framework like Slim, apigility, etc.

But I think following any of the above two approaches will be a overhead and re-usability of code will also not be achieved. If the code which is working fine for website should also be used used on mobile apps. There should be no need to write the same code again. That's what I think.

So using the existing APIs from PHPFox website is the best solution that I think, might be I'm wrong. If you think I'm wrong please correct my approach.

If you could explain with some useful example it would be really great.

I've gone through PHPFox docs as well but couldn't get anything useful which could help me in the issue I'm facing. If you are also interested in documentation of PHPFox please go to below links:

  1. http://unity.moxi9.com/docs
  2. http://unity.moxi9.com/kb

If you could find anything useful related to the issue I'm facing please do let me know.

  • 写回答

1条回答 默认 最新

  • dongzhilian0188 2015-01-27 17:53
    关注

    Well everything you are looking for is already there in the docs. Your mobile app would be registered as an app with PHPFox. You can then use their API. The remaining question is, if the end users need to authorize your mobile app from their "normal" web browser or if this authorization can be performed from the mobile app as well. At least that's what I read from the docs. Since you have an up and running installation at your hand: Just try it! Register an app and perform some requests to their API.

    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?