将服务器生成的网站转换为PhoneGap/Cordova应用程序? [英] Convert server-generated site to PhoneGap/Cordova app?

查看:70
本文介绍了将服务器生成的网站转换为PhoneGap/Cordova应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使具有服务器生成的页面(在我的情况下为Laravel/PHP)作为PhoneGap/Cordova应用程序运行的网站的最省力方法是什么?在导入PhoneGap/Cordova之前,我宁可不必将整个过程转换成一个页面应用程序.

What's the lowest effort way to get a site with server-generated pages (in my case Laravel/PHP) running as a PhoneGap/Cordova app? I'd rather not have to convert the whole thing into a single page app before importing into PhoneGap/Cordova.

是否可以将PhoneGap/Cordova用作非常薄的包装器,并仍然从服务器实时加载每个页面?如果是这样,请问究竟如何?我认为我们不需要任何本机电话API.

Is it possible to use PhoneGap/Cordova as a very thin wrapper and still load each page live from the server? And if so, how exactly please? I don't think we need any native phone APIs.

整个原因是我的客户坚持要拥有一个应用程序",尽管显然我们的网站可以在移动网络浏览器中运行并且可以在用户的​​手机上显示图标.

Reason for the whole thing is my client insists on "having an app" even though obviously our site will work in a mobile web browser and can have an icon on the user's phone.

非常感谢

推荐答案

很遗憾,您的应用必须通过Apple App Store的批准,才能提供一些基本功能并在没有互联网连接的情况下正确显示.这意味着至少,如果您打算在服务器上生成内容,则可能需要Cordova插件来获取网络信息:

Unfortunately for your app to pass Apple App store approval it will have to provide some basic functions and display correctly without an internet connection. This means at a minimum, if you plan to generate content on a server you will probably need the Cordova plugin for network information:

https://cordova.apache. org/docs/en/latest/reference/cordova-plugin-network-information/

我将确保您熟悉《 Apple人机界面指南》:

I would make sure you are familiar with the Apple Human Interface Guidelines:

https://developer.apple.com/ios/human-interface-guidelines/overview/design-principles/

您可能还需要捆绑任何JavaScript.苹果对下载代码(可能包括JavaScript)的应用非常挑剔.

You will probably also need to bundle any JavaScript. Apple is very picky about apps that download code (this can include JavaScript).

这是iOS开发者协议中的一部分.

This is a section from the iOS developer Agreement.

3.3.2除下一节所述外,应用程序不得下载或安装 可执行代码.如果所有脚本,代码和 口译员打包在应用程序中,未下载.唯一的例外 以上是由Apple内置的WebKit框架下载或运行的脚本和代码,或者 JavascriptCore,前提是此类脚本和代码不会改变 通过提供与预期和 提交给App Store的应用程序的广告目的.

3.3.2 Except as set forth in the next paragraph, an Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exceptions to the foregoing are scripts and code downloaded and run by Apple's built-in WebKit framework or JavascriptCore, provided that such scripts and code do not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store.

以下仅是我的意见

我担心的是,如果您以省力的方式进行操作,最好的情况是您将无法通过应用批准.最坏的情况是,用户体验会更糟,甚至更糟,客户的形象也会变差.正确执行此操作,并为该应用程序提供一些其他功能,这些功能是您单独在浏览器中无法拥有的.我会为您的客户提供建议,看看他们是否想要合适的应用来吸引客户并为他们提供出色的体验.

My fear is that if you go at it in a low effort way, best case you will fail app approval. Worst case it will leave users with a poor experience or worse, a poor image of your client. Do it properly and give the app some extra functions that you can't have in a browser alone. I would advise your client of this and see if they would like a proper app that engages their customers and provides them with a great experience.

这篇关于将服务器生成的网站转换为PhoneGap/Cordova应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆