I am getting the following warning on Xcode while setting up foreground push notification on IOS:
Assigning to 'id<UNUserNotificationCenterDelegate> _Nullable'
from incompatible type 'AppDelegate *const __strong'
this warning appears on the last line of this snippet:
// Define UNUserNotificationCenter
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
My app compiles and runs as expected. I have no experience with objective-c, so I have no idea what this is about. How can I solve it?
I had the same issue and solved it by adding UNUserNotificationCenterDelegate to my AppDelegate interfaces:
@interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With