Xcode PhoneGap navigator.connection Undefined

后端 未结 2 507
心在旅途
心在旅途 2021-01-06 19:07

Trying to port my PhoneGap javascript code into Xcode for debugging in iOS. Using Cordova-3.0.0.

When I call:

navigator.connection.type
2条回答
  •  囚心锁ツ
    2021-01-06 19:52

    Been doing my research on this one, and finally came up with the solution. Apparently PhoneGap (Adobe) recently updated their documentation, and filled in a lot of the holes I was running into for Phonegap 3.0.0

    1) To do this using the command-line interface, you have to have git installed to be able to run those commands. Get git here.

    2) They added to the Connection plugin documentation to use the following command-line interface commands to add the plugin to the 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) They updated the declaration in the config.xml file to the following (for iOS):

    
        
    
    

提交回复
热议问题