etodanik / ion-google-place

Ionic directive for a location dropdown that utilizes google maps
MIT License
251 stars 201 forks source link

Works on emulator and browser but on on an actual iPhone or Android phone #54

Open vardas-bill opened 9 years ago

vardas-bill commented 9 years ago

ion-google-place works fine when testing with ionic serve but when I load onto a physical iPhone or Android phone the Google places list does not appear.

My code looks like this:

 <ion-item ng-show="show_profile" >
        <span class="profile-label">CITY/TOWN:</span>
        <ion-google-place placeholder={{city_town_text}} class="city-town" ng-model="location.text"/>
        <div ng-show="show_city_err" class="account-error-message">{{city_err}}</div>
</ion-item>

As far as I can tell it appears to be falling over in the ion-google-place.js file when calling google.maps.Geocoder();

In my index.html file I have:

    <script src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>
    <script src="lib/ion-google-place/ion-google-place.js"></script>
fsbatista commented 9 years ago

Hey Bill, I think this is related to the App Transport Security policy. I had the same problem and once I implemented this patch on my app's plist (https://gist.github.com/mlynch/284699d676fe9ed0abfa) everything worked again!

quedicesebas commented 8 years ago

http://stackoverflow.com/questions/30731785/how-do-i-load-an-http-url-with-app-transport-security-enabled-in-ios-9/30732693#30732693

ulion commented 8 years ago

just use https to load the google places api can also resolve this?