Skip to content

WebGL compilation bug for native web request path property #218

@jzapdot

Description

@jzapdot

Summary

In the latest 5.3.4 release, there is a compiler error for WebGL where this UnityNativeVariablesRequestInterceptor class is attempting to use a UnityNativeRequest.Path property that doesn't exist.

#if UNITY_WEBGL && !UNITY_EDITOR
using System.Collections.Generic;

namespace CleverTapSDK.Native
{
    internal class UnityNativeVariablesRequestInterceptor : IUnityNativeRequestInterceptor
    {
        UnityNativeRequest IUnityNativeRequestInterceptor.Intercept(UnityNativeRequest request)
        {
            if (request.Path == UnityNativeConstants.Network.REQUEST_PATH_DEFINE_VARIABLES)
            {
                request.SetHeaders(new Dictionary<string, string>());
            }
            return request;
        }
    }
}
#endif

We fixed this locally by creating that read-only property Path to the private readonly member.

#if (!UNITY_IOS && !UNITY_ANDROID) || UNITY_EDITOR
using System;
using System.Collections.Generic;
using CleverTapSDK.Utilities;
using UnityEngine.Networking;

namespace CleverTapSDK.Native
{
    internal class UnityNativeRequest {
	    public string Path => _path; // Added workaround property here
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions