ios - Xcode PhoneGap navigator.connection Undefined -


trying port phonegap javascript code xcode debugging in ios. using cordova-3.0.0.

when call:

navigator.connection.type 

i getting 'undefined' navigator.connection.

did not include network connection plugin correctly in config.xml, or else amiss? yes, included correct cordova.js file ios. yes, deviceready has been fired.

update: running on ios emulator.

my config.xml:

<?xml version='1.0' encoding='utf-8'?> <widget id="com.app.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">     <name>hello cordova</name>     <description>         description     </description>     <author email="dev@callback.apache.org" href="http://cordova.io">         apache cordova team     </author>     <access origin="*" />     <preference name="fullscreen" value="true" />     <preference name="webviewbounce" value="true" />     <plugins>         <plugin name="networkstatus" value="cdvconnection" />     </plugins> </widget> 

thank help!

been doing research on one, , came solution. apparently phonegap (adobe) updated documentation, , filled in lot of holes running phonegap 3.0.0

1) using command-line interface, have have git installed able run commands. git here.

2) added connection plugin documentation use following command-line interface commands add plugin project:

$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git $ cordova plugin rm org.apache.cordova.core.network-information 

3) updated declaration in config.xml file following (for ios):

<feature name="networkstatus">     <param name="ios-package" value="cdvconnection" /> </feature> 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -