jamesmontemagno / Xamarin.Plugins

Cross-platform Native API Access from Shared Code!
MIT License
1.3k stars 380 forks source link

Connectivity Throwing an error #214

Closed ibrahimAJ closed 8 years ago

ibrahimAJ commented 8 years ago

connectivity plugin is throwing error like Unable to resolve host.no address is associated with host.internet,network state,wifi state permissions also given in androidmanifest.xml,but that dns in the hostname is not accepting.why.what is the reason behind that

jamesmontemagno commented 8 years ago

What URL are you passing it?

ibrahimAJ commented 8 years ago

www.tranzportal.ie it is ping in commandprompt but in app its not reaching

jamesmontemagno commented 8 years ago

Specifically the documentation reads: ///

/// Tests if a remote host name is reachable (no http:// or www.) ///

/// Host name can be a remote IP or URL of website /// Port to attempt to check is reachable. /// Timeout in milliseconds. /// Task IsRemoteReachable(string host, int port = 80, int msTimeout = 5000);

Note: Tests if a remote host name is reachable (no http:// or www.)

I assume you are using this method? You need to be more specific about what exactly you are doing.

ibrahimAJ commented 8 years ago

i tried using http:// or www but when i use this way it is throwing unresolve host but when we pass only ip address as url that is not reaching but in commanprompt it is pingable.what may be reason behind that?

jamesmontemagno commented 8 years ago

When you go to that URL it is a 500 error so I assume it can't reach it as it is returning an error. On Feb 10, 2016 10:43 PM, "ibrahimAJ" notifications@github.com wrote:

i tried using http:// or www but when i use this way it is throwing unresolve host but when we pass only ip address as url that is not reaching but in commanprompt it is pingable.what may be reason behind that?

— Reply to this email directly or view it on GitHub https://github.com/jamesmontemagno/Xamarin.Plugins/issues/214#issuecomment-182738416 .

ibrahimAJ commented 8 years ago

yes i am getting that 500 error in broswer when i test with that url

ibrahimAJ commented 8 years ago

but how it is ping in commandprompt

jamesmontemagno commented 8 years ago

Most likely different protocol that it is trying. Try google.com or any other website that is running I am sure it will work just fine. On Feb 10, 2016 11:12 PM, "ibrahimAJ" notifications@github.com wrote:

but how it is ping in commandprompt

— Reply to this email directly or view it on GitHub https://github.com/jamesmontemagno/Xamarin.Plugins/issues/214#issuecomment-182742212 .

ibrahimAJ commented 8 years ago

using www.google.com as hostname to check whether the server is reachable or not is showing server not reachable only.but whatever the url i said www.tranzportal.ie is not working but working for both ios and windows.

jamesmontemagno commented 8 years ago

What device and what OS are you using?

On Thu, Feb 11, 2016 at 1:48 AM, ibrahimAJ notifications@github.com wrote:

using www.google.com as hostname to check whether the server is reachable or not is showing server not reachable only.

— Reply to this email directly or view it on GitHub https://github.com/jamesmontemagno/Xamarin.Plugins/issues/214#issuecomment-182785446 .

James Montemagno http://www.montemagno.com @jamesmontemagno http://www.twitter.com/jamesmontemagno

ibrahimAJ commented 8 years ago

Nexus One(3.7",480x800;hdpi),android 5.0.1-API Level21

jamesmontemagno commented 8 years ago

Do you see anything in the log cat or can you try to run the actual code and see what the exception is. Running fine for me on my device (6P) and also emulators: image

I assume you have the internet permission checked in release mode