Flutter FCM Ios 未显示在设备上 [英] Flutter FCM Ios not showing on device

查看:35
本文介绍了Flutter FCM Ios 未显示在设备上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用程序和所有东西中添加了 fcm,但我可以在我的 xcode 控制台中看到通知正文,但在设备中它没有显示也尝试在前台模式下不起作用.

I have add fcm in my application and all things but i can see notification body in my xcode console but in device its not showing also try in foreground mode not working.

我在 info.plist 中添加了 FirebaseDelegateProxyEnabled

I add FirebaseDelegateProxyEnabled in my info.plist

我添加了后台模式和推送通知

I have added background mode and push notification

即使我添加了 APNs 身份验证密钥,但仍然无法正常工作.我不知道剩下什么我可以在控制台中看到我的通知但是为什么它没有显示在设备中我什至尝试最小化应用程序

Even i have added APNs Authentication Key But still is not working. I don't know what is remaining i can see my notification in console but why its not showing in device i even i try to minimize the app

这是我的控制台,显示通知数据

Here is my console its showing notification data

2021-07-08 17:21:54.566047+0500 Runner[30106:10113438] flutter: on message {from: 110426208872, collapse_key: com.igidrive, notification: {e: 1, body: test again 123}}

推荐答案

我一周前遇到了这个问题

I had this issue a week ago

我在此处没有看到您的应用委托代码.

I don't see your code here for the app delegate.

您可以验证是否在 AppDelegate.swift> 中添加了以下代码,如果没有,请添加.

You can please verify did you add the below code in your AppDelegate.swift if not then please add.

if (@available(iOS 10.0, *)) {
  [UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>) self;
 }

另外,请确保您征得用户许可

Also, make sure you are asking user permission

myFirebaseMessagingService.requestNotificationPermissions(
        const IosNotificationSettings(
            sound: true, badge: true, alert: true, provisional: false));

更改 info.plist 中的这一行

Change this line in your info.plist

 FirebaseAppDelegateProxyEnabled: false

如果一切正常,请卸载该应用程序并尝试重新安装该应用程序一段时间.

这篇关于Flutter FCM Ios 未显示在设备上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆