navigator.connection.type not working even if device is ready *or* device is never ready

前端 未结 2 719
小鲜肉
小鲜肉 2021-01-15 00:29

I\'m trying to make a simple app with Phonegap, compiled with Adobe Phonegap builder. I\'ve found and used the well documented example for using navigator.connection.type wh

2条回答
  •  独厮守ぢ
    2021-01-15 00:58

    I had the same issue and found I had to run "cordova build" and then the status was returned correctly.

    BEWARE When I run cordova build, it appears to take everything in my ~/app/www directory and overried everything in app/platforms/android/assets/www/

    My "install process" is as follows:

    cordova create app com.app "App"
    cd app
    cordova platform add android
    cordova plugin add org.apache.cordova.network-information
    cordova plugin add org.apache.cordova.camera
    cordova plugin add org.apache.cordova.geolocation
    cordova build
    

    I can then do code changes in app/www and when happy, 'deploy' it using 'cordova build' (which seems to always copy the files to app/platforms/android/assets/www/.

    If I add another plugin using: (for example)

    cordova plugin add org.apache.cordova.file
    

    then I need to run

    cordova build
    

    to have it work.

    I hope this helps

    (I am using cordova 3.3.1-0.1.2 )

提交回复
热议问题