I’m getting class not found, just in android, IOS works normal, anyone already had this problem?
I already exclude the android platform and put it again, it did not solve, already tried with another project, also did not solve …
I always have problem with Android, IOS always and everything easier … but I need the android too …
my config.xml
plugin name="phonegap-plugin-push" spec="^ 2.1.3">
<variable name="FCM_VERSION" value="11.6.2" />
<variable name="SENDER_ID" value="42116867643" />
</ plugin>
<platform name="android">
<resource-file src="google-services.json" target = "application/ google-services.json" />
</ platform>
my .ts file
console.log('hasPermission - before');
this.push.hasPermission().then((res: any) => {
console.log('hasPermission - after', res);
...
}).catch(error => {
console.log('hasPermission - error ', error );
throw error; //-> here i got the error 'CLASS NOT FOUND'
});
setTokenPush(){
const options: PushOptions = {
android: {
senderID: '42116867643'
},
ios: {
alert: 'true',
badge: true,
sound: 'true'
},
windows: {},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
}
};
const pushObject: PushObject = this.push.init(options);
pushObject.on('notification').subscribe((notification: any) => {
let ethereumStr: string = notification.additionalData.data; // get the string
let data: { datas: string } = JSON.parse(ethereumStr);
this.response = data;
this.data_ethereum = this.response.datas.ethereum;
this.data_bitcoin = this.response.datas.bitcoin;
this.data_litecoin = this.response.datas.litecoin;
this.storage.set('data_ethereum', this.data_ethereum);
this.storage.set('data_litecoin', this.data_litecoin );
this.storage.set('data_bitcoin', this.data_bitcoin);
this.navCtrl.push(LoadingPage,{
"message_loading":notification.title,
"type":"receive",
});
});
pushObject.on('registration').subscribe((registration: any) => {
this.configPushUser(registration.registrationId);
});
pushObject.on('error').subscribe(error => {
});
}
configPushUser(token){
this.webservice.configPushUser(token).subscribe(data=>{
});
}