Perhaps not surprisingly, System.Text.Json.Serializer does not appear to function on iOS likely owing to the lack of Emit support.
public class ChatMessage
{
[JsonPropertyName("id")]
public string Id { get; set; }
[JsonPropertyName("sent")]
public DateTime? SentOn { get; set; }
}
JsonSerializer.Deserialize<ChatMessage>(json);
This yields:
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) void :invoke_callvirt_void_ChatMessage_Nullable1<DateTime> (Chat.Messaging.ChatMessage,System.Nullable1<System.DateTime>)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.