简体   繁体   English

.ipa文件fom build.phonegap.com在iPhone中不起作用

[英].ipa file fom build.phonegap.com is not working in iPhone

I am working on phonegap to build an application for both android and iPhone. 我正在研究phonegap,以为Android和iPhone构建应用程序。 This is the first application I am building for phonegap but I am facing some severe issues. 这是我为phonegap构建的第一个应用程序,但是我遇到了一些严重的问题。 Firstly I am explaining what I am doing in this application 首先,我在解释我在此应用程序中正在做什么

I have created a www folder which consist of two html file(index.html,dashboard.html) and some css and js(there is a cordova.js which is in Phonegap 2.9.0 ) files. 我创建了一个www文件夹,其中包含两个html文件(index.html,dashboard.html)以及一些CSS和js(在Phonegap 2.9.0中有一个cordova.js)文件。

And I have created a config.xml file. 并且我创建了一个config.xml文件。

And after that I have made a zip file and paste it in the upload section in https://build.phonegap.com 之后,我制作了一个zip文件,并将其粘贴到https://build.phonegap.com的上载部分中

Here is my config.xml file 这是我的config.xml文件

 <?xml version="1.0" encoding="utf-8"?>

<cordova>
<!--
access elements control the Android whitelist.
Domains are assumed blocked unless set otherwise
 -->

<access origin="http://127.0.0.1*"/> <!-- allow local pages -->
<!-- <access origin="https://example.com" /> allow any secure requests to example.com -->
<!-- <access origin="https://example.com" subdomains="true" /> such as above, but including subdomains, such as www -->
<access origin="http://google.com" subdomains="true" />


<access origin=".*"/>

<!-- <content src="http://mysite.com/myapp.html" /> for external pages -->
<!-- <content src="index.html" />-->

<log level="DEBUG"/>
<preference name="phonegap-version" value="2.9.0" />
<preference name="useBrowserHistory" value="true" />
<preference name="exit-on-suspend" value="false" />
<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
<plugin name="Device" value="org.apache.cordova.Device"/>
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
<plugin name="File" value="org.apache.cordova.FileUtils"/>
<plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
<plugin name="Notification" value="org.apache.cordova.Notification"/>
<plugin name="Storage" value="org.apache.cordova.Storage"/>
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
<plugin name="Capture" value="org.apache.cordova.Capture"/>
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
<plugin name="Echo" value="org.apache.cordova.Echo" />
<plugin name="Globalization" value="org.apache.cordova.Globalization"/>
<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser"/>
<plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>
<plugin name="PdfViewer" value="com.phonegap.plugins.pdf.PdfViewer"/>
<plugin name="FileOpener" value="com.phonegap.plugins.fileOpener.FileOpener"/>  
<plugin name="Downloader" value="com.phonegap.plugins.downloader.Downloader"/>
<plugin name="StatusBarNotification"       value="com.phonegap.plugins.statusBarNotification.StatusBarNotification"/>
</plugins>
</cordova>

And my index.html file is like that: 我的index.html文件是这样的:

    <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--><head>
<meta charset="utf-8" />
<!-- Set the viewport width to device width for mobile -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sid Agency App</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/cordova.js"></script>
<script type="text/javascript" charset="utf-8" src="js/file.js"></script>
<script type="text/javascript" charset="utf-8" src="js/downloader.js"></script>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/organictabs.jquery.js"></script>

<script type="text/javascript">
    $(function() {
        $("#main_container").organicTabs();
    }); 
</script>

<script type="text/javascript">
$(document).ready(function() {
    var value = window.localStorage.getItem("key");
    if (value == "5") {
        top.location.href = "dashboard.html";
    } else {
        $("#content").css("top", $("#header").height() + "px");
        $("#content").height($(window).height() - $("#footer").height() + "px");
        $("#content_inner").height($("#content").height() - $("#footer").height() + "px");

        var user_data = {
            login_id: 1234,
            pin_code: 1234
        };
       ...........//so on

And my App id in build.phonegap.com is 401033. 我在build.phonegap.com中的应用程序ID是401033。

I have made some code in my src file for plugin in eclipse. 我在src文件中为eclipse中的插件做了一些代码。

But My issue is 但是我的问题是

Now when I am testing the application from eclipse to my device it is working as expected. 现在,当我从eclipse到我的设备测试应用程序时,它可以正常工作。

When I am testing the app in iPhone simulator through xcode nothing is coming except some alert like gap:["Device","getDeviceInfo","Device984611098"], 当我通过xcode在iPhone模拟器中测试该应用程序时,除了诸如gap:[“ Device”,“ getDeviceInfo”,“ Device984611098”]之类的警报外,什么都没有发生,
gap:["NetworkStatus","getConnectionInfo","NetworkStatus984611099"], gap:["App","show","App984611100"] . 差距:[“ NetworkStatus”,“ getConnectionInfo”,“ NetworkStatus984611099”],差距:[“ App”,“ show”,“ App984611100”]。

Now if i remove this line from both html file App is working fine in simulator. 现在,如果我从这两个html文件中删除此行,App在模拟器中的运行情况都很好。

 <script type="text/javascript" src="js/cordova.js"></script>

But when I am downloading the apk file from build.phonegap.com I can see everything is running fine except the plugins like Fileopener, Downloader (you can see i have mentioned it in config.xml file within plugin tag). 但是,当我从build.phonegap.com下载apk文件时,我可以看到一切正常,除了Fileopener,Downloader之类的插件(您可以看到我已经在plugin标签内的config.xml文件中提到了它)。 None of these plugins are working at all. 这些插件都无法正常工作。

Same when I am downloading .ipa file from build.phonegap.com in iPhone nothing is coming as every content is coming trough ajax i cant see them any of them but it is coming in android. 同样,当我从iPhone中的build.phonegap.com下载.ipa文件时,没有任何反应,因为所有内容都通过ajax传输,我看不到它们中的任何一个,但它来自android。

I have tried a lot to fix the problem but nothing helps. 我已经尝试了很多解决此问题的方法,但是没有任何帮助。 Can anyone help me? 谁能帮我? what's wrong I am doing? 我在做什么错? Thanks in advance. 提前致谢。

如果您为应用程序安装了适用于Android的phonegap,请使用其指南安装ios的phonegap,然后从您创建的HelloWorld应用程序复制js / cordova.js文件并使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM