Hi, when you send two or more requests by using fcm-node in a .js script there is an error that says that the app already exists.
In the node_modules/fcm-node there is a file called fcm.js
My solution is to edit this file, like this (I had already done this and it works):
else{ //accountkey object passed, new SDK 'de-promisefy' use <--- STAYS THE SAME
if(firebaseadmin.apps[0]){
firebaseadmin.apps[0].delete()
}
firebaseadmin.initializeApp({
credential: firebaseadmin.credential.cert(accountKey)
});
this.send = function(payload, _callback){ <--- STAYS THE SAME
Hi, when you send two or more requests by using fcm-node in a .js script there is an error that says that the app already exists.
In the node_modules/fcm-node there is a file called fcm.js
My solution is to edit this file, like this (I had already done this and it works):
else{ //accountkey object passed, new SDK 'de-promisefy' use <--- STAYS THE SAME if(firebaseadmin.apps[0]){ firebaseadmin.apps[0].delete() } firebaseadmin.initializeApp({ credential: firebaseadmin.credential.cert(accountKey) }); this.send = function(payload, _callback){ <--- STAYS THE SAME