Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mlynch/capacitor-push-test
https://github.com/mlynch/capacitor-push-test
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mlynch/capacitor-push-test
- Owner: mlynch
- Created: 2018-03-29T03:03:48.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-30T20:46:05.000Z (almost 7 years ago)
- Last Synced: 2024-12-05T11:04:01.395Z (29 days ago)
- Language: JavaScript
- Size: 439 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
First, we need to add the Google Services references to our app:
Add to your root `build.gradle`:
```gradle
buildscript {
// ...
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// Add this line:
classpath 'com.google.gms:google-services:3.2.0'
}
}// Add this block
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
}
```Next, we need to add the dependencies for Ionic Push Notifications as well as Firebase. This is required because
Capacitor's push notifications uses FCM which must be referenced in your app's gradle to function properly.Add to your `app/build.gradle`:
```gradle
dependencies {
// ... other dependecies above here
implementation 'ionic-team:ionic-native-plugins-core:0.0.4'
implementation 'ionic-team:ionic-native-push-notifications:0.0.4'
compile 'com.google.firebase:firebase-core:12.0.1'
compile 'com.google.android.gms:play-services-base:12.0.1'
compile 'com.google.android.gms:play-services-location:12.0.1'
}apply from: 'capacitor.build.gradle'
apply plugin: 'com.google.gms.google-services'
```Next, there are two services that need to be linked in your Android Manifest:
Add to your `AndroidManifest.xml`:
Install `capacitor-push-notifications`:
```bash
npm install capacitor-push-notifications
```Update platforms:
```bash
npx cap update
```