[英]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 ) : 我看了这些类似的问题( 但不走运 ):
and so many others, I tried out their solutions, such as 还有很多其他人,我尝试了他们的解决方案,例如
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.