-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenSettings() from CXCallDirectoryManager stopped working in .NET 8.0 for iOS #21008
Comments
I can reproduce, and the device log also shows:
This looks like Apple is validating a bit too much :/ We might have to come up with some sort of workaround here. I haven't tried this, but I suspect that if you create a tiny Objective-C library that calls this method it'll work. |
Never mind, this is a bug on our side. Fix is in progress. |
Pending: * Tests * Better description. Fixes xamarin#21008.
…tures. Fixes #21008. (#21048) When we compute the signature of a block for Objective-C, we need to use parameters of the user-provided callback (and not the intermediate UnmanagedCallersOnly method) to compute the signature. This is because the intermediate method's parameters don't have all the information we need to correctly compute the block signature (in particular for the issue in question, the user callback has an `NSError` parameter, while the intermediate method has an `IntPtr` parameter, and these two parameter types show up differently in the block signature). This is solved by adding the `UserDelegateType` attribute (which was created for exactly this, and it's just in older generated code) to the intermediate method, pointing to a delegate with the correct managed signature. Fixes #21008. Backport of #21011
@rolfbjarne Thanks for taking care, I'm facing the same issue on .NET MAUI iOS. |
It will be included in our next service release (which should be within a few weeks). |
We have a iOS app that we recently migrated from Xamarin.iOS to .NET 8.0 for iOS. After this update opening the "Call Blocking & Identification" settings on the iOS device stopped working.
https://developer.apple.com/documentation/callkit/cxcalldirectorymanager/opensettings(completionhandler:)
Steps to Reproduce
Call OpenSettings() somewhere in the app like this:
CXCallDirectoryManager.SharedInstance.OpenSettings(_ => { }));
Expected Behavior
The phone's "Call Blocking & Identification" settings should be opened.
Actual Behavior
This fails since the update and nothing happens when calling it.
For testing I built a blank native Swift app just calling OpenSettings() when pressing a button and here the phone correctly navigates to the caller id settings page.
Logs
The NSError I get in the .NET version is the follwing:
And the MacOS console logs the follwing information:
The text was updated successfully, but these errors were encountered: