turbolinks / turbolinks-ios

Native iOS adapter for building hybrid apps with Turbolinks 5
MIT License
881 stars 92 forks source link

Unable to load Google Maps #57

Closed andyrsmith closed 8 years ago

andyrsmith commented 8 years ago

Hello,

Has anyone successfully be able to get a turbolinks-ios app to display a google maps?

The map displays fine in the web browser, but when I fire it up in the iOS app the map doesn't display. It is just empty space. I have removed all javascript from the web pages except for the https://maps.googleapis.com/maps/api/js, jquery and turbolinks.

I just have the basic google maps js code to create the map. var map; function initMap() { map = new google.maps.Map(document.getElementById('map'), { center: {lat: -34.397, lng: 150.644}, zoom: 8 }); }

Again this works in the web browser but not the iOS app.

Thanks,

andyrsmith commented 8 years ago

It appears to have been an issue with not specify Https. My code was originally using http://maps.googleapis.com/maps/api/js instead of the preferred https://maps.googleapis.com/maps/api/js.

It looks like turbolinks-ios apps does not like making non-secure connections, so I'm not sure if that is the intended behavior or not.

zachwaugh commented 8 years ago

@andyrsmith thanks for the update, iOS apps as of 9.0 require HTTPS for all network connections unless you explicitly opt-out in your app's Info.plist. We do that in our demo server to get around that limitation here - https://github.com/turbolinks/turbolinks-ios/blob/master/TurbolinksDemo/Info.plist#L25-L29