如何:PhoneGap构建导航到web应用程序,而不是index.html? [英] How to: PhoneGap Build navigate to web app instead of index.html?
问题描述
背景
(根据此答案及其问题 )我有一个在 http://www.example.com
托管的完全响应的网络应用程序,我只想让我的移动应用程序指向那里用户。
我按照以下过程:
-
$ cordova create myProject
- 打开
config.xml
- 更改
index.html
至http://www.example.com
现在我有以下 config.xml
文件。
config.xml
<?xml version ='1.0'encoding ='utf-8'?
< widget id =io.cordova.hellocordovaversion =0.0.1xmlns =http://www.w3.org/ns/widgetsxmlns:cdv =http:// cordova .apache.org / ns / 1.0>
< name> HelloCordova< / name>
< description>
响应deviceready事件的示例Apache Cordova应用程序。
< / description>
< author email =dev@cordova.apache.orghref =http://cordova.io>
Apache Cordova团队
< / author>
< content src =http://www.example.com/>
< plugin name =cordova-plugin-whitelistversion =1/>
< access origin =*/>
< allow-intent href =http:// * / */>
< allow-intent href =https:// * / */>
< allow-intent href =tel:*/>
< allow-intent href =sms:*/>
< allow-intent href =mailto:*/>
< allow-intent href =geo:*/>
< platform name =android>
< allow-intent href =market:*/>
< / platform>
< platform name =ios>
< allow-intent href =itms:*/>
< allow-intent href =itms-apps:*/>
< / platform>
< / widget>
问题
href =https://build.phonegap.com/apps =nofollow> PhoneGap Build 并测试我的.apk文件,结果不能按预期执行。
问题
$ b b
我做错了什么?如何让此移动应用指向example.com所需的网址?
@Mowzer
更新:2015-11-21:
截至2015年11月20日下午1点(PST),< platform(...)> 是
config.xml
的可行元素。
请参阅Phonegap Build博客< a href =http://phonegap.com/blog/2015/11/19/config_xml_changes_part_two/ =nofollow>config.xml获取更新 - 第2部分!!!!!!
您在哪里取得这个范例程式码?我现在已经看到几十个副本,他们都有同样的错误。也就是说, platform
不适用于 Phonegap Build 。主要原因是< platform(...)>
仅适用于Cordova / Phonegap SDK。 (我花了很多时间来弄清楚这一点。
此外,白名单
您的更正: b
$ b
幸运的是你不太遥远。删除所有白名单
的内容,从这里开始。
请让我知道你从哪里得到这个例子。
TIA
Jesse
Background
(Per this answer and its question) I have a fully responsive web app hosted at http://www.example.com
and I just want my mobile app to point the user there.
I followed this procedure:
$ cordova create myProject
- Open
config.xml
- Change
index.html
tohttp://www.example.com
Now I have the following config.xml
file.
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>HelloCordova</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="dev@cordova.apache.org" href="http://cordova.io">
Apache Cordova Team
</author>
<content src="http://www.example.com" />
<plugin name="cordova-plugin-whitelist" version="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
</widget>
Problem
When I use PhoneGap Build and test my .apk file, the result does not perform as expected. Instead of seeing the web page at example.com, I appear to get the original index.html file anyway!
Question
What am I doing wrong? How can I get this mobile app to point to my desired URL at example.com?
@Mowzer
UPDATE: 2015-11-21:
As of Nov 20, 2015 at 1pm PST, <platform (...)>
is a viable element for config.xml
.
See the Phonegap Build blog post "config.xml gets an update - part 2 !!!!!!"
Where are you getting this example code? I've now seen dozens of copy and they ALL have the same mistake. Namely, platform
does NOT apply to Phonegap Build. The main reason is <platform (...)>
only applies to Cordova/Phonegap SDK. (It took me along time to figure this out. SEE #1 near the bottom.
In addition, the whitelist
system is NOT being applied correctly. I'd like to find this source and get it corrected.
Your Corrections:
Luckily you are not too far along. Remove all the whitelist
stuff and start here.
HOW TO apply the Cordova/Phonegap the whitelist system
Please let me know where you got this example from.
TIA Jesse
这篇关于如何:PhoneGap构建导航到web应用程序,而不是index.html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!