Skip to content

Commit

Permalink
Added ability to change the Android play services version
Browse files Browse the repository at this point in the history
  • Loading branch information
dapriett committed Aug 21, 2016
1 parent b0847fd commit 9a92655
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ cp -r node_modules/nativescript-google-maps-sdk/platforms/android/res/values app

Next modify the file at `app/App_Resources/Android/values/nativescript_google_maps_api.xml`, uncomment `nativescript_google_maps_api_key` string and replace `PUT_API_KEY_HERE` with your api key.

The plugin will default to latest available version of the Android `play-services-maps` SDK. If you need to change the version, you can add a project ext property `googlePlayServicesVersion` like so:

```
// /app/App_Resources/Android/app.gradle
project.ext {
googlePlayServicesVersion = "+"
}
```

## Setup iOS API Key

In the main script of your app `app.js`, use the following to add the API key (providing your key in place of `PUT_API_KEY_HERE`)
Expand Down
4 changes: 4 additions & 0 deletions demo/app/App_Resources/Android/app.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
project.ext {
// Uncomment below to change Google Play Services Version
//googlePlayServicesVersion = "+"
}
2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "2.1.0"
},
"tns-android": {
"version": "2.1.1"
"version": "2.2.0"
}
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-google-maps-sdk",
"version": "1.3.7",
"version": "1.3.8",
"description": "Google Maps SDK plugin for Nativescript",
"main": "map-view.js",
"nativescript": {
Expand Down
3 changes: 2 additions & 1 deletion platforms/android/include.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ android {
}

dependencies {
compile 'com.google.android.gms:play-services-maps:+'
def googlePlayServicesVersion = project.hasProperty('googlePlayServicesVersion') ? project.googlePlayServicesVersion : '+'
compile "com.google.android.gms:play-services-maps:$googlePlayServicesVersion"
}

0 comments on commit 9a92655

Please sign in to comment.