Cordova plugin for network information always return connection.type=UNKNOWN on iOS simulator -


i trying check internet connection on app. when launch app on ios emulator, doesn't work! have use code: https://gist.github.com/welcomattic/c6415563d6607fbedf3e

i have 2 problems:

1) when debug, see $ionicplatform.ready (line 16 of code on github) never fired. i've tried know understand why didn't find solution.

2) have tried make code work without $ionicplatform.ready. connection.type= unknown. have changed code several times, 'unknown'.

so wonder,

1) simulator doesn't support plugin?

2) there problem code or missing something?

thank answers!

well, have found solution (it small things drives crazy).

here answer:

i using command: $cordova emulate ios emulate app using ionic platform: "$ionic emulate ios"

what can bring confusion app launch "$cordova" , work functionalities won't. confuses me.

anyway...

if had same issue, sure remove ios platform obtained using "$cordova platform add ios" , "$cordova emulate ios" before trying "$ionic emulate ios".

so, solve problem, there 2 simple steps:

1) remove ios cordova platform (in console tap):

$cordova platform remove ios 

2) add ios ionic platform (in console tap):

$ionic platform add ios $ionic build ios $ionic emulate ios 

that's it!


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -