const FCM = cordova.exec('fcm-node');
const apiKey = 'AIzaSyDrzCXUxUmlBiGQNKFkZavsLKv1zjDKc1Y';`enter code here`
const deviceID =
'fBgVGG3AB0:APA91bEJdEjnRmMWi8lLksi9gPv6ztUpokdYWzyjx7
oWCLb7lktoshK34ozbL7kxcTUizwXZZeW01wvjgcPC34377IZ6czXuCP3N77
vzwmXKOYP2orcIdo572sjPfGItXah1HjwJdF-B';
const fcm = new FCM(apiKey);
const message = {
to: deviceID,
data: {
title: 'Force Start',
message: 'This notification should restart the app',
'force-start': '1'
}
};
fcm.send(message, (err, response) => {
if (err) {
alert(err);
alert('Something has gone wrong!');
} else {
alert('Successfully sent with response: ', response);
}
});