Local weather ... next steps

Well after seeing some working examples of this project it looks like problems with mobile devices because members are getting the data by IP address (usually with ipinfo.io) and not the expected HTML5 GetLocation

But then this HTML5 function will only work if you have a codepen subscription to include SSL (or HTTPS if you prefer). It’s useless to trick codepen changing the address to HTPPS, it may work on local tests but if you pick a mobile phone it will be very unlikely that it’ll work (that is what I’ve found with my mobile tests).

What I intend to do with my almost complete project is to host it in (free) https://byet.host get a free SSL certificate in https://certbot.eff.org post the code in codepen with a link to the working example (and maybe a link to the explained steps I’ve taken) but need to test it first (today I’m taking a code break).

What do you think?
Feedback pls :wink:

I’m not exactly sure what you mean here. I would first test whether the browser has access to the location API. If not, simply display an error for the user and tell them to try connecting to the site via HTTPS. A normal part of a programmer’s life is making sure your programs error out gracefully. You can host it elsewhere and get your HTTPS cert if you want, but it’s not necessary to get this to work.

What I am unable is to start from a mobile device in a non-ssl address (like the free codepen) is the HTML5 plugin GetLocation.
GetLocation is what I want to use (not an IP location service knowing very well that the ip can be very tricky/far from the user who is using the app/site).
The error message I intend to use it will be a simple if:
if (navigator.geolocation){
LocatingUser();
} else {
$("#message").html("Unable to locate … please use https:\“future.built.site.org”)
}
(& I bet that at least 90% of the mobiles will fall in the else statement)
I have no hurries in finishing the FCC projects, I am more concerned that they will be valid and useful :wink:
Best regards,

EDIT: just popped into my mind (because I was trying to confugure byet free hosting with SSL that lead me to open a ticket for them…). Does Heroku supports (free) SSL without problems?

Geolocation is well supported. I made up a quick demo, which works on all mobile browsers I tried on iOS. Check it yourself and see if you can find a mobile browser that doesn’t work with it.

No need to test on mobile, in my Ubuntu no Geolocation works (a crumbled PC), on my Windows machine I get this results on my codepen but on your example
My questions would be is COMODO CA SSL free? Are you allowed to use SSL in free codepen?
Probably you’ll have a better explanation than me … I think :unamused:
Of course we can still be friends on LinkedIn!

SSL is set up on the server, and your CodePen account has nothing to do with server configuration. Try going to https://codepen.io and opening your pen from there. I think they have either misconfigured their server, or they don’t have certificates set up for ‘s.codepen.io’.

Also, which browser are you using in Ubuntu? Unless you’ve set up some specific security policies, there’s nothing about the OS or hardware that should prevent geolocation from working.

1 Like

pumping and running (on win7)! https://codepen.io/LuisGonzaga/pen/BzVkdk

Thank you for the help, but there are few things I’ll better explain:

  1. my previous message (and confusion) was due to the use of images from photobucket that don’t use SSL, my first approach was to change them to google drive … but the photo sharing was deprecated there, after looking for https photo sharing I got postimg.org and the SSL became fine.
  2. then js wasn’t working properly but the coordinates where being caught … so after a few kicks in the code it started working fine.
  3. My Ubuntu machine as problems with GetLocation, can’t tell you exactly why, but it is an old machine in a couple weeks the drives from SATA1 will go down, in 3 or 4 months SATA2 drives will also go down and I will have to pick my wife’s Vacuum cleaner and put everything up again. Then the GeoLocation will probably be working fine (as I’ve seen it work a few days back … but only for a couple of hours), then it returns to this or this (notice both example have HTTPS)
    I’ll still give this project some final details … but also putting it on Heroku (using a fake PHP) seems to me a good idea, especially because the SSL from codepen can go down at any moment.

Best regards,