当 setting up foreground push notification on IOS 时,我在 Xcode 上收到以下警告:
Assigning to 'id<UNUserNotificationCenterDelegate> _Nullable'
from incompatible type 'AppDelegate *const __strong'
此警告出现在此代码段的最后一行:
// Define UNUserNotificationCenter
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
我的应用程序按预期编译并运行。我没有使用 Objective-C 的经验,所以我不知道这是什么。怎么解决呢?
最佳答案
我遇到了同样的问题,并通过将 UNUserNotificationCenterDelegate
添加到我的 AppDelegate 接口(interface)来解决它:
@interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate>
关于ios - 在 React Native 前台设置 PushNotificationIOS 时发出警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58022324/