Firebase ตรวจไม่พบแอปที่กระพือปีกของฉัน และไม่สามารถส่งการแจ้งเตือนแบบพุชได้

Firebase ตรวจไม่พบแอป Android ของฉัน (ในส่วนการตั้งค่า ซึ่งเป็นขั้นตอนสุดท้ายซึ่งก็คือ 'เรียกใช้แอปของคุณเพื่อตรวจสอบการติดตั้ง') ฉันไม่สามารถส่งการแจ้งเตือนไปยังแอปได้เช่นกัน ฉันได้นำเข้าแพ็คเกจที่สำคัญทั้งหมด (คอร์และการส่งข้อความ) และได้ทำทุกอย่างตาม บทความกลาง ฉันยังได้ตรวจสอบคำถามเกี่ยวกับ stackoverflow มากมาย เช่น สิ่งนี้ แต่ถึงกระนั้น ฉันก็ยังไม่สามารถรับการแจ้งเตือนแบบพุชในอุปกรณ์ของฉันได้ (โปรแกรมจำลอง genymotion) มีข้อผิดพลาดที่แจ้งว่า:

E/FirebaseInstanceId( 7264): Topic sync or token retrieval failed on hard failure 
exceptions: INVALID_SENDER. Won't retry the operation.
W/FirebaseMessagingPlugin( 7264): getToken, error fetching instanceID:                                             
W/FirebaseMessagingPlugin( 7264): java.io.IOException: INVALID_SENDER                                              
W/FirebaseMessagingPlugin( 7264):       at 
com.google.firebase.iid.zzl.zza(com.google.firebase:firebase-iid@@20.0.2:71)
W/FirebaseMessagingPlugin( 7264):       at 
com.google.firebase.iid.zzl.zza(com.google.firebase:firebase-iid@@20.0.2:84)
W/FirebaseMessagingPlugin( 7264):       at 
com.google.firebase.iid.zzp.then(com.google.firebase:firebase-iid@@20.0.2:4)
W/FirebaseMessagingPlugin( 7264):       at com.google.android.gms.tasks.zzd.run(Unknown 
Source)                    
W/FirebaseMessagingPlugin( 7264):       at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/FirebaseMessagingPlugin( 7264):       at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/FirebaseMessagingPlugin( 7264):       at java.lang.Thread.run(Thread.java:818)                                   
W/FirebaseMessagingPlugin( 7264): getToken, error fetching instanceID:                                             
W/FirebaseMessagingPlugin( 7264): java.io.IOException: INVALID_SENDER                                              
W/FirebaseMessagingPlugin( 7264):       at 
com.google.firebase.iid.zzl.zza(com.google.firebase:firebase-iid@@20.0.2:71)
W/FirebaseMessagingPlugin( 7264):       at 
com.google.firebase.iid.zzl.zza(com.google.firebase:firebase-iid@@20.0.2:84)
W/FirebaseMessagingPlugin( 7264):       at 
com.google.firebase.iid.zzp.then(com.google.firebase:firebase-iid@@20.0.2:4)
W/FirebaseMessagingPlugin( 7264):       at com.google.android.gms.tasks.zzd.run(Unknown 
Source)                    
W/FirebaseMessagingPlugin( 7264):       at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/FirebaseMessagingPlugin( 7264):       at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/FirebaseMessagingPlugin( 7264):       at java.lang.Thread.run(Thread.java:818) 

โปรดช่วยฉันแก้ไขปัญหานี้


person Jatin Pandey    schedule 03.04.2020    source แหล่งที่มา
comment
ตามที่กล่าวไว้ด้านล่าง ตรวจสอบให้แน่ใจว่ารวม google-services.json ไว้ในแอปพลิเคชันในตำแหน่งที่ถูกต้อง นอกจากนี้ให้ลองใช้ flutter clean ดู หากปัญหายังคงอยู่ คุณสามารถรวมข้อมูลโค้ดสำหรับการเริ่มต้น FCM ได้หรือไม่   -  person Zachery Misson    schedule 03.04.2020
comment
ใช่ การใช้ flutter clean ช่วยแก้ปัญหาได้ ขอบคุณ!   -  person Jatin Pandey    schedule 04.04.2020


คำตอบ (1)


คุณต้องเพิ่ม google-services.json ในโครงการ

person Bret Hagen    schedule 03.04.2020