capacitor-community / capacitor-community/fcm
Requested entity was not found on iOS device
- Dominant language
- TypeScript
- Stars
- 272
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
When I tried to send a push notification from my node.js server, the iOS devices got this error:
> Requested entity was not found
The code to send the notification is this:
```
var admin = require("firebase-admin");
// Get it from firebase console -> service accounts
var serviceAccount = require("../fcmKey.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
});
export const sendFCM = (dest: string[], title: string, content: string) => {
const msg = {
data: { title, content },
notification: {
title,
body: content,
},
tokens: dest,
};
admin
.messaging()
.sendMulticast(msg)
.then((response: any) => {
// Response is a message ID string.
console.log("Successfully sent message:", response);
})
.catch((error: any) => {
console.log("Error sending message:", error);
});
};
```
I read that the token should be refreshed, but this library does not have a way to refresh the token.
Please advice.
Contributor guide
Research direction
The report provides a Node.js/TypeScript sendMulticast example using firebase-admin, a service-account file, and destination tokens, but names no repository file or test. Start by reproducing the iOS notification failure and checking the Firebase project configuration and token lifecycle. Done means identifying the cause of the “Requested entity was not found” response and documenting or fixing the relevant library behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, ios, node.js, typescript
- Domain
- backend, cloud, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100