christianmenkens
christianmenkens

Reputation: 790

IBM Worklight 5.0.6.1 - Mobile Browser Simulator - WL.Device.getNetworkInfo for navigator.network.connection.type vs. navigator.connection.type

We see a different behavior in the MBS and on our iOS and Android devices.

In the Simulator:

simulator

On the devices:

The implication is that the following call:

WL.Device.getNetworkInfo(function (networkInfo) {
  alert (networkInfo.ipAddress); 
  }
);

Upvotes: 0

Views: 703

Answers (2)

nspeete
nspeete

Reputation: 659

Both navigator.network.connection.type and navigator.connection.type are supported in the latest Worklight 6.1's Mobile Browser Simulator (Worklight 6.1 uses Cordova 3.1). Up to Cordova 2.3.0, the Connection object was accessed from navigator.network.connection. After Cordova 2.3.0 it was changed to navigator.connection. Navigator.network.connection is still available in Cordova 3.1, but is deprecated and will be eventually removed from Cordova.

Upvotes: 1

Idan Adar
Idan Adar

Reputation: 44516

I'm not sure why this works (and not works) in the MBS, but please do note that the WL.Device.getNetworkInfo API method is supported only in iOS and Android.

Upvotes: 0

Related Questions