Open juniorsaraviao opened 4 months ago
I have the same issue. It suddenly happened. One week ago, my code worked, and last Thursday/Friday I did not change any code and I get this error message.
It has something to do with the response that the package receives from Azure, because the registration (in my case) IS made. So the call is successful, but the NuGet Package can't parse the response (I think).
EDIT: Can't guarantee my above statement is true, may be an already existing registration.
@TAbbott117 I saw you replying on an other issue, so I tag you, because now the whole package is not working @aimankhan I found you as a contributor specialized in Notification Hub, so tagged you too.
BTW, the calls for Android stuff are working fine, no exceptions on those method calls. Only the Apple calls are returning this exceptions
I have the exactly the same issue, it started happening after the pipeline workloads automatically updated some sdks (with red are the new values):
I found a shady workaround for this issue. I integrated the NotificationHubs project directly into my solution and modified the AppleRegistrationDescription at runtime. I added the PushVariables element before the DeviceToken element:
Steps:
I didn't investigate to see why the error is there, at first sight it seems that something is not working right in the System.Serialization or XMLSerializer, because it doesn't take into account that PushVariables element is optional/not required. Hence the fix to add an empty PushVariables element if it doesn't exist.
It doesn't seem like we are getting a response here. I just checked and it still crashes. What to do? Submit the bug elsewhere? But where? @TAbbott117 @aimankhan @pmngo @jessHuh
any updates on this issue?
Good news, with the latest workloads, it started working again. I reverted my workaround.
Hi! I just tried the latest workload and got the following exception.
System.Runtime.Serialization.SerializationException: ErrorInLine, 1, 1098 UnexpectedElementExpectingElements, Element, DeviceToken, http://schemas.microsoft.com/netservices/2010/10/servicebus/connect, PushVariables
I did a complete cleanup of my environment. Deleted dotnet folder, installed 8.0.401 .NET SDK, and ran command: "sudo dotnet workload install maui". Workaround was not needed anymore for me. For now it seems to work, I can let you know later this month once we release this to production if it went well or not. :)
Same issue here
RegisteredForRemoteNotifications Exception: System.Runtime.Serialization.SerializationException: Error in line 1 position 1009. 'Element' 'DeviceToken' from namespace 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect' is not expected. Expecting element 'PushVariables'.
Reinstalled dotnet 8.0.402 (version newer) and did dotnet workload install maui... > resulting in MAUI 8.0.82/8.0.100 Besides that I work with
I found a workaround, for my use case....but there are still issue in this repo when 'PushVariables' or 'Tags' aren't used.
var appleRegistration = new AppleRegistrationDescription(token, tags);
appleRegistration.PushVariables = new Dictionary<string, string>()
{
{ "azure_notificationhubs_dotnet_issue", "missing PushVariables fix" }
};
var registration = await hub.CreateRegistrationAsync(appleRegistration);
Currently im always re-creating a registration, instead of retrieving an old one. Because methods like GetRegistrationsByChannelAsync do get the same errors, and by removing old registrations and re-creating new, it won't get the errors.
Describe the bug I'm currently migration a .NET Maui app from .NET 7 to .NET 8. I'm currently using Microsoft.Azure.NotificationHubs v4.2.0 but the app crashes while using CreateAppleTemplateRegistrationAsync
Exception or Stack Trace
To Reproduce
Code Snippet
Expected behavior The CreateAppleTemplateRegistrationAsync should register the template without any issues. Using the same code in .NET Maui (.NET 7) works as expected.
Setup (please complete the following information):
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report