22// ----------------------------------------------------------------------------
33
44const NPM_MODULE_NAME = 'react-native-maps'
5- const NPM_MODULE_VERSION = '0.16.4'
6- const PLAY_SERVICES_VERSION = '16.1.0'
7- // const PLUGIN_PATH = __dirname
8- const APP_PATH = process . cwd ( )
5+ const NPM_MODULE_VERSION = '0.26.1'
96const EXAMPLE_FILE = 'MapsExample.js.ejs'
107
11- const GRADLE_CONFIG = `
12- compile(project(':react-native-maps')) {
13- exclude group: 'com.google.android.gms', module: 'play-services-base'
14- exclude group: 'com.google.android.gms', module: 'play-services-maps'
15- }
16- compile 'com.google.android.gms:play-services-base:${ PLAY_SERVICES_VERSION } '
17- compile 'com.google.android.gms:play-services-maps:${ PLAY_SERVICES_VERSION } '
18- `
19-
208const add = async function ( context ) {
219 const { ignite, print } = context
2210
2311 // install a npm module and link it
24- await ignite . addModule ( NPM_MODULE_NAME , { version : NPM_MODULE_VERSION , link : true } )
12+ await ignite . addModule ( NPM_MODULE_NAME , { version : NPM_MODULE_VERSION , link : false } )
2513 // add our component example to the plugin component examples screen
2614 await ignite . addPluginComponentExample ( EXAMPLE_FILE , { title : 'Maps Example' } )
2715
28- // add the app build gradle config
29- ignite . patchInFile ( `${ APP_PATH } /android/app/build.gradle` , {
30- insert : GRADLE_CONFIG ,
31- replace : `\n compile project(':react-native-maps')`
32- } )
33-
3416 print . warning ( `⚠️ Using Google Maps on Android? ⚠️` )
3517 print . info ( '' )
3618 print . info ( ` If you're using Google Maps on Android (this is the default), there's still another step.` )
@@ -56,15 +38,10 @@ const remove = async function (context) {
5638 const { ignite } = context
5739
5840 // remove the npm module and unlink it
59- await ignite . removeModule ( NPM_MODULE_NAME , { unlink : true } )
41+ await ignite . removeModule ( NPM_MODULE_NAME , { unlink : false } )
6042 // remove our component example from the plugin component examples screen
6143 await ignite . removePluginComponentExample ( EXAMPLE_FILE )
6244
63- // Remove the app build gradle config we added
64- ignite . patchInFile ( `${ APP_PATH } /android/app/build.gradle` , {
65- delete : GRADLE_CONFIG
66- } )
67-
6845 // TODO: Remove API key
6946 // android/app/src/main/AndroidManifest.xml
7047}
0 commit comments