[英]Firebase flutter push notification not working on android
我已經注冊了我的應用程序,將 google-services.json 文件添加到我的應用程序文件夾中。 我添加了必需的 depndcies 等。當我從 firebase 控制台發送通知時,我仍然做了所有事情,無論我的應用程序是最小化還是前台,我都沒有收到。 我什至沒有在我的調試控制台中看到任何東西。 我的 AVD 也有 google play 服務。
<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/app_icon" />
firebase_core: ^1.4.0
firebase_messaging: ^10.0.4
await Firebase.initializeApp();
await FirebaseMessaging.instance
.setForegroundNotificationPresentationOptions(
alert: true,
badge: true,
sound: true,
);
await FirebaseMessaging.instance.requestPermission(
alert: true,
announcement: false,
badge: true,
carPlay: false,
criticalAlert: false,
provisional: false,
sound: true,
);
試試這個,希望對你有幫助。 不幸的是,我不記得所有細節。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.