-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
iOS push notification fails with NotificationHubClient in release mode #24118
Comments
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! Open similar issues:
Closed similar issues:
|
Could you maybe try this and see if that helps: #11131 (comment) |
I also tried it with this:
but this causes the whole app to crash, I can't even start it. |
@rolfbjarne @dalexsoto thoughts? @intellimedhu can you attach the exception you are seeing? |
No idea what's going on here, but the exception details + stack trace might help us to start looking in the right direction. |
|
I wonder if it's the linker removing stuff. Can you try disable the linker + enable the interpreter: <PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
<UseInterpreter>true</UseInterpreter>
<MtouchLink>None</MtouchLink>
</PropertyGroup> and see if that changes anything? |
Sorry for the late reply. This causes the whole app to crash, it can't even start. |
What about this? This should be pretty close to the working Debug configuration. <PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
<UseInterpreter>true</UseInterpreter>
<MtouchUseLlvm>false</MtouchUseLlvm>
</PropertyGroup> |
This solved the problem, thank you! I was able to receive notifications, which were sent through the Azure Hub. |
That's great! It looks like this is a problem with our LLVM support then. Would you be able to provide a test project we could use to reproduce the problem in order to track it down and fix it?
Not compiling with LLVM can make the app slightly smaller (LLVM typically produces more code) although also slightly slower. Depending on the app, the slowness can range from impossible to measure to a noticeable delay, in particular for apps that use a lot of math in C# (for instances games). Most UI apps won't see any difference whatsoever though. If your app feels responsive as usual, then you're fine performance-wise. |
I created a test project and invited you. But I also found out what causes the problem. |
That's interesting. Can you get an MSBuild binlog for a build that works, and one that doesn't? |
I uploaded the two binlog to the test repo. |
We have a class library that uses the Microsoft.Azure.NotificationHubs which our maui app references. The notifications work in debug, and when releasing the app using Ad-hoc to firebase. However when the same code is uploaded to TestFlight using AppStoreConnect as distribution, we get nothing. I tried disabling the linker and enabling the interpreter but no luck. |
Description
I was able to send push notifications in debug to my iPhone, through AzureNotificationHub.
But it fails in release mode (using TestFlight).
Using nuget package: Microsoft.Azure.NotificationHubs 4.2.0
During debugging, I found out that it fails to register to the NotificationHub.
When calling NotificationHubClient.CreateOrUpdateRegistrationAsync() method, it throws an exception.
Exception:
I tried enabling the Mono interpreter, just like they recommended in a previous issue and in the documentation but the problem still remains.
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
8.0.80 SR8
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS 17.5.1
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: