28
Views
6
Comments
Solved
Cordova Error - APP Generate
Question

Hi,

Im trying to use google maps for mobile using cordova.

I've downloaded this forge component (https://www.outsystems.com/forge/component-overview/1942/google-maps-plugin) but detect this one uses the UIWebView in iOS, so this will rejected by Apple when we try to publish.

I've changed the extensability to this github (https://github.com/mapsplugin/cordova-plugin-googlemaps) the cordova plugin must have this configuration

Then set your Google Maps API keys into your config.xml (Android / iOS).

<widget ...>
  <preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="(api key)" />
  <preference name="GOOGLE_MAPS_IOS_API_KEY" value="(api key)" />
</widget>

the problem is how i can configure this properties? I already try to set this on preferences and --variables but with no success. 

or {"preferences": { "android": [{ "name": "GOOGLE_MAPS_ANDROID_API_KEY", "value": "APIKEY" }], "ios": [{ "name": "GOOGLE_MAPS_IOS_API_KEY", "value": "APIKEY" }] } }

Anyone can helps? 

Thanks in advance.

AndroidBuildLog.txt

Rank: #403
Solution

Fábio Vaz wrote:

Hi Ricardo, yes already test it but with same result :(


Hi Shailesh, actually we use the reactive web version but as a several errors and because of that we need to change to "native one".



 

 {

    "preferences": 

    {

      "global" : [{

        "name": "GOOGLE_MAPS_ANDROID_API_KEY",

                "value": "API_KEY"

            },

            {

                "name": "GOOGLE_MAPS_IOS_API_KEY",

                "value": "API_KEY"

    }]

    }

}

 Solution.

Rank: #11332

Hello Fábio.

I believe that you have to configure the extension using the "extensibility configurations". You can find it by selecting the root of the widget tree on the plugin and checking the very last line in advanced. 

You will need to generate your native code again and reinstall the app on the phones for the changes to take effect.

Rank: #11332

Oh didn't see you were already using it on the right spot. On the original plugin the JSON is worded somewhat diferent - without IOS and Android separation for instance. Have you tried:


{

    "resource" : "cordova-plugin-googlemaps-master.zip",

    "plugin": {

        "resource" : "cordova-plugin-googlemaps-master",

        "variables": [

            {

                "name": "API_KEY_FOR_ANDROID",

                "value": "AIzaSyAitsPQJTuNXjYJM4DcM67OLaXyjGx-PBM"

            },

            {

                "name": "API_KEY_FOR_IOS",

                "value": "AIzaSyB1p4Z2B1pl3qAxZiYZk8Rz-YgjDjAdk4Y"

            }

        ]

    }

}


to be more in line with the original JSON?

Rank: #1782

Fábio Vaz wrote:

Hi,

Im trying to use google maps for mobile using cordova.

I've downloaded this forge component (https://www.outsystems.com/forge/component-overview/1942/google-maps-plugin) but detect this one uses the UIWebView in iOS, so this will rejected by Apple when we try to publish.

I've changed the extensability to this github (https://github.com/mapsplugin/cordova-plugin-googlemaps) the cordova plugin must have this configuration

Then set your Google Maps API keys into your config.xml (Android / iOS).

<widget ...>
  <preference name="GOOGLE_MAPS_ANDROID_API_KEY" value="(api key)" />
  <preference name="GOOGLE_MAPS_IOS_API_KEY" value="(api key)" />
</widget>

the problem is how i can configure this properties? I already try to set this on preferences and --variables but with no success. 

or {"preferences": { "android": [{ "name": "GOOGLE_MAPS_ANDROID_API_KEY", "value": "APIKEY" }], "ios": [{ "name": "GOOGLE_MAPS_IOS_API_KEY", "value": "APIKEY" }] } }

Anyone can helps? 

Thanks in advance.

 Hi Fabio,

Please check out this plugin if it is of any use for you.

https://www.outsystems.com/forge/component-overview/7387/google-map-location-picker-for-reactive-web-and-mobile-apps 

Cheers