Skip to content

Instantly share code, notes, and snippets.

@mfdeveloper
Created July 4, 2019 01:44
Show Gist options
  • Select an option

  • Save mfdeveloper/2607207404c9b94c96c80bd940b119a6 to your computer and use it in GitHub Desktop.

Select an option

Save mfdeveloper/2607207404c9b94c96c80bd940b119a6 to your computer and use it in GitHub Desktop.
// This is a working .gradle file for cordova-plugin-fcm-with-updated plugin,
// to use with cordova-android 6.3.0
def FCM_CORE_VERSION = System.getenv("FCM_CORE_VERSION") ?: '16.0.9'
def FCM_VERSION = System.getenv("FCM_VERSION") ?: '18.0.0'
buildscript {
repositories {
mavenCentral()
jcenter()
mavenLocal()
// google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
// classpath 'com.android.tools.build:gradle:3.4.1'
/**
* Reference: https://github.com/google/play-services-plugins/issues/22
*
* PS: 4.2.0 throws a NullPointerException when use gradle plugin
* com.google.gms.googleservices.GoogleServicesPlugin class reference
* instead of id(string)
*/
// classpath 'com.google.gms:google-services:4.1.0'
classpath 'com.google.gms:google-services:3.0.0'
}
}
repositories {
mavenCentral()
jcenter()
// google()
}
dependencies {
compile "com.google.firebase:firebase-core:${FCM_CORE_VERSION}"
compile "com.google.firebase:firebase-messaging:${FCM_VERSION}"
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment