1 Reply Latest reply on Jun 10, 2017 9:23 PM by JohnDurbin

    PhoneGap Build changes for Google map last few years

    JohnDurbin

      Hi. It's been a couple years or so since I updated my PhoneGap build app. I am making my app current and cannot get Google Maps and geocoding to work. For now I'm just trying to get it to work on Android. What am I missing? I am unsure if my access origin, whitelisting and plugins are ok. My code for Google maps and geocoding works in a web page and jsfiddle so I am not including it here unless needed but the code won't work in PhoneGap Build.

       

      Here is my config.

      <pre>

       

      <?xml version="1.0" encoding="UTF-8" ?>

       

         <widget xmlns = "http://www.w3.org/ns/widgets"

        xmlns:gap = "http://phonegap.com/ns/1.0"

        id = "com.mydomainname.myapp"

        versionCode = "10"

        version = "1.0.0" >


         <!-- versionCode is optional and Android only -->

       

          <!--<preference name="phonegap-version" value="3.3.0" />-->

          <preference name="prerendered-icon" value="true" /><!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen -->

          <!--<preference name="target-device" value="handset" />-->

          <preference name="target-device" value="universal" />

          <!--<preference name="fullscreen" value="true" />-->

          <preference name="auto-hide-splash-screen" value="true" /><!-- ios: if set to false, the splash screen must be hidden using a JavaScript API -->

          <preference name="load-url-timeout" value="60000" />

         

          <!--iOS7 status bar-->

          <!--<preference name="StatusBarOverlaysWebView" value="true" />-->

         

         <name>MyApp</name>

         <description>My App</description>

         <author href="mydomainname.com" email="developer@mydomainname.com">Me</author>

       

          <!--icons-->

          <icon src="icon.png" />

       

          <!--iOS-->

          <platform name="ios">

          <!--iOS 7.0+-->

          <!-- iPhone / iPod Touch -->

          <icon src="icons/ios/icon-60.png" platform="ios" width="60" height="60" />

          <icon src="icons/ios/icon-60-2x.png" platform="ios" width="120" height="120" />


          <!-- iPad -->

          <icon src="icons/ios/icon-76.png" platform="ios" width="76" height="76" />

          <icon src="icons/ios/icon-76-2x.png" platform="ios" width="152" height="152" />


          <!-- Settings Icon -->

          <icon src="icons/ios/icon-small.png" platform="ios" width="29" height="29" />

          <icon src="icons/ios/icon-small-2x.png" platform="ios" width="58" height="58" />


          <!-- Spotlight Icon -->

          <icon src="icons/ios/icon-40.png" platform="ios" width="40" height="40" />

          <icon src="icons/ios/icon-40-2x.png" platform="ios" width="80" height="80" />

       

          <!-- iOS 6.1 -->

          <!-- iPhone / iPod Touch -->

          <!--<icon src="icon.png" platform="ios" width="57" height="57" />-->

          <icon src="icons/ios/icon-57.png" platform="ios" width="57" height="57" />

          <!--<icon src="icon@2x.png" platform="ios" width="114" height="114" />-->

          <icon src="icons/ios/icon-ios-57-2x.png" platform="ios" width="114" height="114" />


          <!-- iPad -->

          <!--<icon src="icon-72.png" platform="ios" width="72" height="72" />-->

          <icon src="icons/ios/icon-72.png" platform="ios" width="72" height="72" />

          <!--<icon src="icon-72@2x.png" platform="ios" width="144" height="144" />-->

          <!-- retina iPad support: PhoneGap 2.5.0+ only -->

          <icon src="icons/ios/icon-72-2x.png" platform="ios" width="144" height="144" />


          <!-- iPhone Spotlight and Settings Icon -->

          <icon src="icons/ios/icon-small-6.png" platform="ios" width="29" height="29" />

          <icon src="icons/ios/icon-small-2x-6.png" platform="ios" width="58" height="58" />


          <!-- iPad Spotlight and Settings Icon -->

          <icon src="icons/ios/icon-50.png" platform="ios" width="50" height="50" />

          <icon src="icons/ios/icon-50-2x.png" platform="ios" width="100" height="100" />

       

          </platform>

       

          <!--Android-->

          <platform name="android">

          <icon src="icons/android/ldpi.png" platform="android" density="ldpi" />

          <icon src="icons/android/mdpi.png" platform="android" density="mdpi" />

          <icon src="icons/android/hdpi.png" platform="android" density="hdpi" />

          <icon src="icons/android/xhdpi.png" platform="android" density="xhdpi" />

          <icon src="icons/android/xxhdpi.png" platform="android" density="xxhdpi" />

          </platform>

       

          <!--Windows Phone-->

          <platform name="winphone">

          <icon src="icons/winphone/icon-windows-phone-48.png" platform="winphone" />

          <icon src="icons/winphone/icon-windows-phone-173.png" platform="winphone" role="background" />

          </platform>

       

          <!--Splash Screens-->

          <splash src="splash.png" />

       

          <!--iOS-->

          <platform name="ios">

          <!-- iPhone and iPod touch -->

          <!--<splash src="Default.png" platform="ios" width="320" height="480" />-->

          <splash src="splash/ios/screen-iphone-portrait.png" platform="ios" width="320" height="480" />

          <!--<splash src="Default@2x.png" platform="ios" width="640" height="960" />-->

          <splash src="splash/ios/screen-iphone-portrait-2x.png" platform="ios" width="640" height="960" />


          <!-- iPhone 5 / iPod Touch (5th Generation) -->

          <!--<splash src="Default-568h@2x.png" platform="ios" width="640" height="1136" />-->

          <splash src="splash/ios/screen-iphone-portrait-586-2x.png" platform="ios" width="640" height="1136" />


          <!-- iPad -->

          <splash src="splash/default-portrait-ipad.png" platform="ios" width="768" height="1024" />

          <splash src="splash/default-landscape-ipad.png" platform="ios" width="1024" height="768" />


          <!-- Retina iPad -->

          <!--<splash src="Default-Portrait@2x.png" platform="ios" width="1536" height="2048" />-->

          <splash src="splash/screen-portrait-ipad-2x.png" platform="ios" width="1536" height="2048" />

       

          <splash src="splash/default-landscape-ipad-2x.png" platform="ios" width="2048" height="1536" />

       

          </platform>

       

          <!--Android-->

          <platform name="android">

          <splash src="splash/android/screen-ldpi-portrait.png" platform="android" density="ldpi" />

          <splash src="splash/android/screen-mdpi-portrait.png" platform="android" density="mdpi" />

          <splash src="splash/android/screen-hdpi-portrait.png" platform="android" density="hdpi" />

          <splash src="splash/android/screen-xhdpi-portrait.png" platform="android" density="xhdpi" />

          <splash src="splash/android/screen-xxhdpi-portrait.png" platform="android" density="xxhdpi" />

          </platform>

         

          <!--Windows Phone-->

          <platform name="winphone">

          <splash src="splash/winphone/winphone-screen-portrait.jpg" platform="winphone" />

          </platform>


          <!-- Plugins -->

          <!-- Core plugins -->

          <plugin name="cordova-plugin-console" spec="~1.0.6" />

          <!--<plugin name="org.apache.cordova.contacts" />-->

          <plugin name="cordova-plugin-device" spec="~1.1.5" />

          <plugin name="cordova-plugin-dialogs" spec="~1.3.2" />

          <plugin name="cordova-plugin-geolocation" spec="~2.4.2" />

          <plugin name="cordova-plugin-inappbrowser" spec="~1.7.0" />

          <plugin name="cordova-plugin-network-information" spec="~1.3.2" />

          <plugin name="cordova-plugin-splashscreen" spec="~4.0.2" />

          <!--<plugin name="cordova-plugin-statusbar" spec="~2.2.2" />-->

          <plugin name="cordova-plugin-whitelist" spec="~1.3.2" />

         

         <!-- Third party plugins -->

       

          <!-- Access Origin & Whitelist -->

          <access origin="https://mydomainnamehere.com" />

          <access origin="https://google.com" />

          <access origin="https://*.google.com" />

       

           <!--development-->

          <access origin="*" />

          <allow-navigation href="*" />

       

      </widget>

      </pre>