Skip to content
Open
Show file tree
Hide file tree
Changes from all 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,47 @@
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
// Suppress system browser only when --alttester runtime flag is set; Editor/QA builds carry the ALTTESTER define but still need wallet login.
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