Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Banner only works with provided url not googgle, facebook, amazon ect #14

Closed
liveaffiliates opened this issue Apr 26, 2020 · 2 comments
Closed

Comments

@liveaffiliates
Copy link

Hi,

Thanks for creating this.

I am trying to implement but have run into strange behavior with the following line:

ConnectivityUtils.instance.setServerToPing("https://gist.githubusercontent.com/Vanethos/dccc4b4605fc5c5aa4b9153dacc7391c/raw/355ccc0e06d0f84fdbdc83f5b8106065539d9781/gistfile1.txt");

It works great with the address you provided but if I comment out that line I thought it would default to www.google.com but I just get no connectivity.

If I change it to google, facebook, amazon all give no connectivity like so:

  ConnectivityUtils.instance.setServerToPing("http://www.google.com");
  ConnectivityUtils.instance.setServerToPing("http://www.facebook.com");
  ConnectivityUtils.instance.setServerToPing("http://www.amazon.com");

I am not sure why only your provided text file is working. I am currently staying in Indonesia, that's all I can think.

Is there any way for me to debug whats going on?

Thanks

@Vanethos
Copy link
Owner

The new version will have #13 integreated, which will check for all the status codes between 200 and 399.

This might be due to the fact that some of the websites were returning 204, for example, and the library was not correctly handling them

If you can, please try with the new version (I'll upload it in a few hours)

@ebot64
Copy link

ebot64 commented May 27, 2020

Using "http://example.com/" with a callback works for me as follow:

ConnectivityUtils.initialize( serverToPing: "http://example.com/", callback: (response) => response.isNotEmpty );

This works for me.

@Vanethos Vanethos closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants