简体   繁体   English

MismatchSenderId错误Firebase云消息传递(FCM)

[英]MismatchSenderId error Firebase Cloud Messaging (FCM)

I have been facing this error for days, I have read almost every question on this topic, but I haven't figured out the solution. 我已经连续数天遇到这个错误,我已经阅读了有关该主题的几乎所有问题,但是我没有找到解决方案。

Please don't mark this as duplicate (I have already looked in the previous Questions). 请不要将此标记为重复(我已经在前面的问题中查找过)。

I had a look at these similar questions ( But no luck ) : 我看了这些类似的问题( 但不走运 ):

Question 1 问题1

Question 2 问题2

Question 3 问题3

and so many others, I tried out their solutions, such as 还有很多其他人,我尝试了他们的解决方案,例如

  1. Checking whether am using the legacy server or server key or sender Id and the google-services.json file of the same project, on my end it was all correct. 检查我是否正在使用旧服务器服务器密钥发件人ID以及同一项目的google-services.json文件,在我看来,这都是正确的。
  2. Invalidating cache of android studio and restart. 使android studio的缓存无效并重新启动。
  3. Cleaning the project and rebuilding it still it doesn't work. 清理项目并重建它仍然无法正常工作。

I am using a python library called pyfcm to send notifications to the Android Application, but no luck, below is the function : 我正在使用一个名为pyfcm的python库将通知发送到Android应用程序,但是没有运气,下面是该函数:

def sendMessages():

    push_service = FCMNotification(api_key="AIzaSyxxxxxxxxx")
    registration_id = "fd9JpOrrSbc:APA91bHOmsE99dtUXXXXXXXXXXXXXXXX"
    message_title = "Cool Me"
    message_body = "Hi john, your customized news for today is ready"
    result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title,
                                               message_body=message_body)

Below is the output : 以下是输出:

{'multicast_ids': [8943443862024247709], 'success': 0, 'failure': 1, 'canonical_ids': 0, 'results': [{'error': 'MismatchSenderId'}], 'topic_message_id': None}

This is issue started this week, but the previous one this task was working fine as expected. 这是本周开始的问题,但是上一个任务按预期工作正常。

I also read on the firebase error documentation error documentation 我还阅读了Firebase错误文档错误文档

I know there are lots of issues which cause this but this was my experience I wanted to share, so am using a Mac Core I5, 16 GB Processor 2.3 GHz Intel Core, what I did was to clone the project from Github on to my workmate's PC with the same specifications, and the Registration Device ID worked successfully. 我知道有很多问题会导致这种情况,但这是我想分享的经验,因此我使用的是Mac Core I5、16 GB处理器2.3 GHz Intel Core,我所做的是将项目从Github克隆到我的同事的具有相同规格的PC,并且注册设备ID成功运行。

my IDE had a problem ( though, I have restarted it a lot, invalidated cache and restarted it, cleaned it, rebuild and build it but didn't work ), so I have just deployed using my workmates PC and it worked. 我的IDE出现了问题( 不过,我已经重新启动了它很多,使缓存无效并重新启动了,清理了,重建并构建了它,但是没有用 ),所以我刚刚使用了我的同事PC进行了部署,并且它起作用了。

So sometimes this error arises because of the IDE. 因此有时由于IDE会出现此错误。 Try as much as you can to clean and rebuild your project. 尽可能多地尝试清理并重建项目。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 调用“ https://fcm.googleapis.com/fcm/send”时,Firebase云消息传递出现内部服务器错误 - Firebase cloud messaging getting internal server error when calling “https://fcm.googleapis.com/fcm/send” Firebase Cloud Messaging(FCM)无法获取数据 - Firebase Cloud Messaging (FCM) not getting data addCompleteListener()尚未解决-Firebase Cloud Messaging(FCM) - addCompleteListener() is not being resolved - Firebase Cloud Messaging (FCM) 如何向FCM(Firebase云消息传递)令牌的特定用户发送消息? - How to send a message to a specific user of an FCM (Firebase Cloud Messaging) token? 在Firebase Cloud Messaging上检查新通知。 (FCM) - Check for new notifications on Firebase Cloud Messaging. (FCM) '发送消息'Firebase云消息传递服务时出错 - 'Error sending message' Firebase Cloud Messaging Service 是否可以在没有 Firebase Cloud Messaging (FCM) 的情况下向所有安装了我的应用程序的设备发送推送通知? - is it possible to make push notifications to all devices which had installed my application without Firebase Cloud Messaging (FCM)? 我无法在我的 android 仿真器中接收 Firebase 云消息传递 FCM - I Can' t receive the Firebase Cloud Messaging FCM In my android emulator FCM Cloud Messaging 与 Notifications 和 Message 的区别 - FCM Cloud Messaging difference from Notifications and Message 如何在我的应用从 Play 商店中删除之前修复暴露的 Firebase 云消息 (FCM) 服务器密钥? - How to fix exposed Firebase Cloud Messaging (FCM) server keys before my app gets removed from Play Store?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM