Skip to content

Commit

Permalink
Fixed windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
BellringerQuinn committed Dec 18, 2023
1 parent 6ce393d commit d41faec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Assets/Editor/SetUrlScheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
using Sequence.Config;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEngine;
#if UNITY_IOS || UNITY_STANDALONE_OSX
using UnityEditor.iOS.Xcode;
#endif

namespace Editor
{
Expand Down Expand Up @@ -35,6 +37,7 @@ public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProj

private static void SetPlistUrlScheme()
{
#if UNITY_IOS || UNITY_STANDALONE_OSX
PlistDocument plist = new PlistDocument();
plist.ReadFromFile(_plistPath);

Expand Down Expand Up @@ -63,6 +66,7 @@ private static void SetPlistUrlScheme()
}

plist.WriteToFile(_plistPath);
#endif
}
}
}
12 changes: 11 additions & 1 deletion Assets/SequenceExamples/Scripts/UI/LoginPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class LoginPanel : UIPanel
private MultifactorAuthenticationPage _mfaPage;
private LoginSuccessPage _loginSuccessPage;
private WaaSDemoPage _waasDemoPage;
private static string _urlScheme;

protected override void Awake()
{
Expand All @@ -38,6 +39,11 @@ protected override void Awake()
SetupLoginHandler(loginHandler);

_loginSuccessPage = GetComponentInChildren<LoginSuccessPage>();

if (_urlScheme == null)
{
_urlScheme = SequenceConfig.GetConfig().UrlScheme;
}
}

public void SetupLoginHandler(ILogin loginHandler)
Expand Down Expand Up @@ -78,7 +84,11 @@ private void OnMFAEmailSentHandler(string email)
private static void PassDeepLinkViaLocalServer()
{
var args = System.Environment.GetCommandLineArgs();
if (args.Length > 1 && args[1].StartsWith(OpenIdAuthenticator.UrlScheme))
if (_urlScheme == null)
{
_urlScheme = SequenceConfig.GetConfig().UrlScheme;
}
if (args.Length > 1 && args[1].StartsWith(_urlScheme))
{
var socketConnection = new TcpClient("localhost", OpenIdAuthenticator.WINDOWS_IPC_PORT);
var bytes = System.Text.Encoding.ASCII.GetBytes("@@@@" + args[1] + "$$$$");
Expand Down

0 comments on commit d41faec

Please sign in to comment.