在带有外部 URL 的 iOS 上使用 PhoneGap/Cordova
我希望我的 phonegap/cordova 应用程序加载外部页面而不是本地页面.
I want my phonegap/cordova app to load an external page and nothing local.
现在我这样做了,但是我的插件 (javascript) 不起作用,因为它们是从本地 index.html 调用的.
Now that i do that , however my plugins (javascript) dont work because they are called from the local index.html.
在这种情况下我该怎么办?我应该将插件放在我的外部 URL 上并将它们加载到外部 index.html 上吗?另外我还应该在那里加载cordova-2.5.0.js?
What do i do in this case? I should put the plugins on my external URL and load them on the external index.html? Also i should also load there the cordova-2.5.0.js ?
如果这是唯一的方法,如果我想加载一个我不拥有服务器的外部页面,但我想启用推送通知,会发生什么?
And if this is the only way , what happens if i want to load an external page that i dont own the server , but i would like to have push notifications enabled?
我将如何启用这些插件?
How would i enable those plugins?
d0nparalias,
看看这个项目:https://dl.dropbox.com/u/930742/so/CordovaBrowserSO.zip
如您所见,里面没有 index.html
或 www/
文件夹.
As you can see there is no index.html
or www/
folder inside.
所有文件都上传到服务器,应用会根据需要下载它们.
All files were uploaded to the server and app will download them as needed.
我已经按照 p.1 中的步骤完成了它.来自 https://stackoverflow.com/a/15319156/753878 答案.
I've accomplished it by doing steps from p.1. from https://stackoverflow.com/a/15319156/753878 answer.
在服务器上,您可以在使用模板 Cordova 项目创建的基本 www/
文件夹中看到所有文件:
At the server I have all files that you can see in basic www/
folder created with template Cordova project:
所有插件和您直接在服务器上的 index.html
中包含的内容.
All plugins & stuff you include directly in index.html
on your server.
如果您从上面的存档中检查 config.xml
,您将看到<content src="http://dymv.comeze.com/www/index.html"/>
If you check config.xml
from the archive above you'll see<content src="http://dymv.comeze.com/www/index.html" />
启动时的应用程序会说:
And the app on launch will say:
希望这是您想要达到的目标.
如果不是 - 请提供有关您想要达到的结果的更多信息.
Hope it's what you want to reach.
If it's not — please provide more info about result you want to achieve.
BR.
尤金