Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static async UniTask<BootstrapContainer> CreateAsync(
DCLVersion dclVersion,
CancellationToken ct)
{
var browser = new UnityAppWebBrowser(decentralandUrlsSource);
var browser = new UnityAppWebBrowser(decentralandUrlsSource, applicationParametersParser);
var web3AccountFactory = new Web3AccountFactory();
var bootstrapContainer = new BootstrapContainer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
using DCL.Multiplayer.Connections.DecentralandUrls;
using Global.AppArgs;
using System;
using UnityEngine;
#if ALTTESTER
using DCL.Diagnostics;
using System.IO;
#endif

namespace DCL.Browser
{
public class UnityAppWebBrowser : IWebBrowser
{
private readonly IDecentralandUrlsSource decentralandUrlsSource;
private readonly IAppArgs? appArgs;

public UnityAppWebBrowser(IDecentralandUrlsSource decentralandUrlsSource)
public UnityAppWebBrowser(IDecentralandUrlsSource decentralandUrlsSource, IAppArgs? appArgs = null)
{
this.decentralandUrlsSource = decentralandUrlsSource;
this.appArgs = appArgs;
}

public void OpenUrl(string url)
{
Application.OpenURL(Uri.EscapeUriString(url));
var escaped = Uri.EscapeUriString(url);

#if ALTTESTER
// Only skip the system browser when an AltTester cross-stack test is actually driving
// this session (client launched with --alttester). Those tests read auth-url.txt and
// navigate their own browser. Without the flag — Editor and dev/QA standalone builds,
// which all carry the ALTTESTER compile define — we must still open the browser or
// wallet login can never complete. The block is stripped from release builds entirely.
Comment thread
cyaiox marked this conversation as resolved.
Outdated
Comment thread
cyaiox marked this conversation as resolved.
Outdated
if (appArgs?.HasFlag(AppArgsFlags.ALTTESTER) == true)
{
try
{
var path = Path.Combine(Application.persistentDataPath, "auth-url.txt");
File.WriteAllText(path, escaped);
}
catch (Exception e)
{
ReportHub.LogException(e, ReportCategory.AUTHENTICATION);
}

return;
}
#endif
Application.OpenURL(escaped);
}

public void OpenUrl(DecentralandUrl url)
Expand Down
Loading