Skip to content
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

Fix for hard-coded nu-get Newtonsoft usage in C# SDK causing Unity IL2CPP builds to crash #219

Merged
merged 5 commits into from
May 9, 2024

Conversation

jakub-grzesiowski
Copy link
Contributor

fix: fix hard-coded nu-get Newtonsoft usage in C# SDK causing Unity IL2CPP builds to crash

Fixes issue of Unity SDK not being able to have a fully independent IJsonPluggableLibrary implementation because of direct nu-get Newtonsoft usage in C# SDK (Unity has it's own version that works with IL2CPP builds)

…PluggableLibrary implementations, remove duplicate/non-IJsonPluggableLibrary-based deserialization logic
@jakub-grzesiowski
Copy link
Contributor Author

IMPORTANT: Probably best to only review and not merge before 06.04.2024 when I come back since this needs a Unity counterpart anyway

Copy link
Contributor

@mohitpubnub mohitpubnub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -114,7 +114,7 @@ public SubscribeManager2(PNConfiguration pubnubConfig, IJsonPluggableLibrary jso
if (!string.IsNullOrEmpty(responseTuple.Item1) && responseTuple.Item2 == null)
{
PNStatus status = new PNStatus(null, PNOperationType.PNSubscribeOperation, PNStatusCategory.PNConnectedCategory, channels, channelGroups);
HandshakeResponse handshakeResponse = JsonConvert.DeserializeObject<HandshakeResponse>(responseTuple.Item1);
HandshakeResponse handshakeResponse = jsonLibrary.DeserializeToObject<HandshakeResponse>(responseTuple.Item1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@@ -14,18 +12,18 @@ public class EmitMessagesHandler : EffectHandler<EmitMessagesInvocation>
{
private readonly Dictionary<string, Type> channelTypeMap;
private readonly Dictionary<string, Type> channelGroupTypeMap;
private readonly JsonSerializer serializer;
private readonly IJsonPluggableLibrary jsonPluggableLibrary;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@jakub-grzesiowski
Copy link
Contributor Author

@pubnub-release-bot release as v6.20.1.0

@jakub-grzesiowski jakub-grzesiowski merged commit 3718f01 into master May 9, 2024
5 checks passed
@jakub-grzesiowski jakub-grzesiowski deleted the json-il2cpp-fix branch May 9, 2024 09:27
@pubnub-release-bot
Copy link
Contributor

🚀 Release successfully completed 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants