Issue with Unity cross-promotion button opening raw text file instead of redirecting to Google Play link

0

I’m currently working on a Unity project and have implemented a cross-promotion button that should open a Google Play link for my app. However, when I click the button, it opens a raw text file hosted on GitHub instead of redirecting to the Google Play link. I’ve tried hosting the Google Play link in a text file on different platforms like GitHub and Google Drive, but the issue persists. I’ve also tried using URL shortening services and redirection techniques, but none of them seem to work. Here’s a simplified version of the script I’m using:

using System.Collections;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.UI;

public class crospromo : MonoBehaviour
{
    public string imageURL;
    public string linkURL;
    private Image image;

    private void Start()
    {
        image = GetComponent<Image>();
        StartCoroutine(LoadImage());
    }

    private IEnumerator LoadImage()
    {
        using (UnityWebRequest www = UnityWebRequestTexture.GetTexture(imageURL))
        {
            yield return www.SendWebRequest();

            if (!www.isNetworkError && !www.isHttpError)
            {
                Texture2D texture = DownloadHandlerTexture.GetContent(www);
                if (texture != null)
                {
                    Sprite sprite = Sprite.Create(texture, new Rect(0f, 0f, texture.width, texture.height), new Vector2(0.5f, 0.5f));
                    image.sprite = sprite;
                }
            }
        }
    }

    public void OnClick()
    {
        Application.OpenURL(linkURL);
    }
}