I am adding push notifications to my ionic app,using the video link-
When building the apk ,I am getting error:-
Error:Execution failed for task ‘:processDebugGoogleServices’.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
I have added the google-play-services.json in my project…inside platforms/android/…
Please help me,where I am wrong…
app.component.ts file-
import { Component } from '@angular/core';
import { Platform,AlertController } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import{Push,PushObject,PushOptions}from'@ionic-native/push';
import { TabsPage } from '../pages/tabs/tabs';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage:any = TabsPage;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,public push:Push,public alertctrl:AlertController) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
this.pushsetup();
});
}
pushsetup()
{
const options:PushOptions={
android:{
senderID:'28839893727'
},
ios:{
},
windows:{
},
};
const pushObject: PushObject=this.push.init(options);
pushObject.on('notification').subscribe((notification:any)=>
{
if (notification.additionalData.foreground)
{
let youralert=this.alertctrl.create({
title:'CheckbookApp',
message:notification.message
})
youralert.present();
}
});
pushObject.on('registration').subscribe((registration:any)=>alert('registred'+registration));
pushObject.on('error').subscribe((error:any)=>alert('error'+error));
}
}
Screenshot of the error:-