Skip to content
This repository was archived by the owner on Jul 27, 2019. It is now read-only.

Removed android build hooks and using the gradle file directly. Updating various Android dependencies for improvements #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<name>Google Firebase Plugin</name>
<description>Cordova plugin for Firebase integration</description>
<keywords>cordova</keywords>
<keywords>cordova,firebase</keywords>
<license>MIT</license>

<engines>
Expand All @@ -15,35 +15,39 @@
</engines>

<platform name="android">
<hook type="after_plugin_install" src="scripts/android/after_plugin_install.js"/>
<hook type="before_plugin_uninstall" src="scripts/android/before_plugin_uninstall.js"/>

<js-module name="FirebasePlugin" src="www/firebase.js">
<clobbers target="FirebasePlugin"/>
</js-module>

<config-file parent="/*" target="res/xml/config.xml">
<feature name="FirebasePlugin">
<param name="android-package" value="org.apache.cordova.firebase.FirebasePlugin"/>
<param name="onload" value="true"/>
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/*">

<config-file parent="/*" target="AndroidManifest.xml">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">

<config-file parent="/manifest/application" target="AndroidManifest.xml">
<service android:enabled="true" android:exported="false"
android:name="com.google.android.gms.measurement.AppMeasurementService"/>

<service android:name="org.apache.cordova.firebase.FirebasePluginMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<receiver android:name="org.apache.cordova.firebase.OnNotificationOpenReceiver"></receiver>

<receiver android:name="org.apache.cordova.firebase.OnNotificationOpenReceiver"/>
</config-file>

<resource-file src="src/android/google-services.json" target="."/>
<resource-file src="src/android/cordova-plugin-firebase-strings.xml" target="res/values/cordova-plugin-firebase-strings.xml"/>

<source-file src="src/android/FirebasePlugin.java" target-dir="src/org/apache/cordova/firebase"/>
<source-file src="src/android/OnNotificationOpenReceiver.java" target-dir="src/org/apache/cordova/firebase"/>
<source-file src="src/android/FirebasePluginMessagingService.java" target-dir="src/org/apache/cordova/firebase"/>
Expand All @@ -59,6 +63,8 @@
<framework src="com.google.firebase:firebase-messaging:19.+"/>
<framework src="com.google.firebase:firebase-config:18.+"/>
<framework src="com.google.firebase:firebase-perf:18.+"/>
<framework src="com.crashlytics.sdk.android:crashlytics:2.10.1"/>
<framework src="me.leolin:ShortcutBadger:1.1.22"/>
</platform>

<platform name="ios">
Expand All @@ -68,16 +74,19 @@
<js-module name="FirebasePlugin" src="www/firebase.js">
<clobbers target="FirebasePlugin"/>
</js-module>

<config-file parent="/*" target="config.xml">
<preference name="deployment-target" value="10.0"/>
<feature name="FirebasePlugin">
<param name="ios-package" value="FirebasePlugin"/>
<param name="onload" value="true"/>
</feature>
</config-file>

<config-file parent="aps-environment" target="*/Entitlements-Debug.plist">
<string>development</string>
</config-file>

<config-file parent="aps-environment" target="*/Entitlements-Release.plist">
<string>production</string>
</config-file>
Expand Down
7 changes: 0 additions & 7 deletions scripts/android/after_plugin_install.js

This file was deleted.

6 changes: 0 additions & 6 deletions scripts/android/before_plugin_uninstall.js

This file was deleted.

118 changes: 0 additions & 118 deletions scripts/android/helper.js

This file was deleted.

21 changes: 11 additions & 10 deletions src/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
buildscript {
repositories {
google()
maven {
url "https://maven.fabric.io/public"
}
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.1.0'
classpath "io.fabric.tools:gradle:1.30.0"
classpath "com.google.gms:google-services:4.2.0"
// Matching it with https://github.com/apache/cordova-android/blob/rel/8.0.0/bin/templates/project/app/build.gradle
classpath "com.android.tools.build:gradle:3.3.0"
}
}

Expand All @@ -15,14 +22,8 @@ repositories {
}
}

dependencies {
compile 'me.leolin:ShortcutBadger:1.1.4@aar'
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
transitive = true
}
}

cdvPluginPostBuildExtras.add({
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
// Use class instead of id (string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
apply plugin: com.crashlytics.tools.gradle.CrashlyticsPlugin
})