Open Redth opened 1 month ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
There is also another warning in the console if you run about some other override. I forget exactly, so when I get to my mac I can update this issue.
There is also another warning in the console if you run about some other override. I forget exactly, so when I get to my mac I can update this issue.
PerformFetch
For .NET 9 Preview 7, we added iOSLifecycle.OnReceivedRemoteNotifications and iOSLifecycle.OnRegisteredForRemoteNotifications lifecycle events in https://github.com/dotnet/maui/pull/23452 (Yay!)
You're missing:
[Export("application:didFailToRegisterForRemoteNotificationsWithError:")]
public void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
Ok, sounds like responds to selector will not be enough, and that the static analysis apple does is going to flag the inclusion of it. We may need to revert these changes for now.
Apple doesn't care about the PerformFetch as much since it is deprecated, but they will not be happy with push hooks if they aren't actually being used. I've been trying to solve this one for a while, but just gave up and document the fact that you have to hook these methods manually
Description
For .NET 9 Preview 7, we added
iOSLifecycle.OnReceivedRemoteNotifications
andiOSLifecycle.OnRegisteredForRemoteNotifications
lifecycle events in #23452 (Yay!)But we forgot to ensure that for cases when an app does not want these implemented, it needs to appear to Apple that it is not using them, otherwise I believe apps will be flagged in submission for not including the appropriate entitlements (need to fact check this).
I believe we could do this by overriding
RespondsToSelector
on the delegate and checking for these selectors and returning false if we have determined the app isn't actually wiring up the registration (need to fact check this).We need to decide how we want to determine that. Maybe we can look at the entitlements at runtime and see if
aps
entitlement is declared? or we can set a flag when registering for the lifecycle event, however this may conflict with cases where someone manually overrides these methods on their delegate. We could also have a property on the delegate to toggle this on and off.Version with bug
9.0.0-preview.7
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
9.0.0-preview.6
Affected platforms
iOS, macOS
Did you find any workaround?
For now, one could manually override RespondsToSelector and return false when these are queried if they do not want to appear to have them implemented.
Thanks @aritchie for noticing this change and helping flag the potential issues with it!