hello,
i am implementing the Firebase push notification with .net core 6 web API when i runs the API all firebase related configuration will take and "sendasync" method returns an error that "InvalidRegistration"
hello,
i am implementing the Firebase push notification with .net core 6 web API when i runs the API all firebase related configuration will take and "sendasync" method returns an error that "InvalidRegistration"
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
vicky suraniPosted Apr 26, 2023, 6:33 AM
Hey
I used the uuid as a token because my application is pwa application so they are not providing me the device token,
so when the app is installed then i create one unique id and stored it in local storage. and then pass that id as an device id so is it proper or not
Amit MohantyPosted Apr 26, 2023, 4:31 AM
The "InvalidRegistration" error message you are receiving from Firebase indicates that the device registration token you are using is either invalid or has become outdated. Here are some possible solutions to try:
Check your Firebase configuration: Make sure that your Firebase project is set up correctly and that your server key is valid. Also, ensure that the package name or bundle identifier of your app is correctly specified in your Firebase console.
Check the device token: Double-check that the device token you are using is valid and up-to-date. If the token is outdated or invalid, you will need to refresh it on the client side and then send the new token to your server.
Ensure the API endpoint is correct: Make sure that you are sending the push notification to the correct endpoint URL. You can find the endpoint URL for FCM in your Firebase console under "Cloud Messaging."
Verify that the payload is valid: Check that the JSON payload you are sending to Firebase is correctly formatted and includes all the required fields. For example, make sure that the "to" field in the payload includes the device token, and that the "notification" field includes the title and body of the notification.
Try a different device: If none of the above solutions work, try sending a push notification to a different device to see if the problem is specific to the device or the configuration.
Check the Firebase console for more details: If the error message persists, check the Firebase console for more details on the error. The console may provide additional information that can help you troubleshoot the issue.
Rajkiran SwainPosted Apr 25, 2023, 2:07 PM
The "InvalidRegistration" error typically indicates that the registration token you are using to send the notification is invalid or expired. Here are some steps you can take to troubleshoot the issue:
Check the registration token: Make sure the registration token you are using is valid and not expired. You can check this by logging into the Firebase console and checking the registration tokens for the corresponding device.
Verify the API Key: Ensure that you have added the correct Firebase API key in your web API project. You can find your Firebase API key in the Firebase console under Project settings > Cloud Messaging.
Check the Firebase project settings: Ensure that your Firebase project settings are properly configured for sending notifications. Make sure that the FCM API key is enabled and the correct sender ID is specified.