Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
CassiusPacheco committed Oct 5, 2023
1 parent 7531833 commit 70bc662
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 5 deletions.
2 changes: 1 addition & 1 deletion sample/Assets/Scripts/UnauthenticatedScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async void Start()
#endif

passport = await Passport.Init(
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
clientId, environment, redirectUri, 10000
#else
clientId, environment, redirectUri
Expand Down
7 changes: 4 additions & 3 deletions src/Packages/Passport/Runtime/Scripts/Public/Passport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private Passport()
/// <param name="redirectUri">(Currently, mobile only) The URL to which auth will redirect the browser after authorisation has been granted by the user</param>
/// <param name="engineStartupTimeoutMs">(Windows only) Timeout time for waiting for the engine to start (in milliseconds)</param>
public static UniTask<Passport> Init(
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
string clientId, string environment, string? redirectUri = null, int engineStartupTimeoutMs = 4000
#else
string clientId, string environment, string? redirectUri = null
Expand All @@ -61,10 +61,11 @@ public static UniTask<Passport> Init(
{
if (Instance == null)
{
Debug.Log($"{TAG} Initialising Passport...");
Instance = new Passport();
// Wait until we get a ready signal
return Instance.Initialise(
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
engineStartupTimeoutMs
#endif
)
Expand Down Expand Up @@ -94,7 +95,7 @@ public static UniTask<Passport> Init(
}

private async UniTask Initialise(
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
int engineStartupTimeoutMs
#endif
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ public GreeBrowserClient()
#if UNITY_ANDROID
string filePath = Constants.SCHEME_FILE + ANDROID_DATA_DIRECTORY + Constants.PASSPORT_DATA_DIRECTORY_NAME + Constants.PASSPORT_HTML_FILE_NAME;
#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
Debug.Log($"Data: {Path.GetFullPath(Application.dataPath)}");
string filePath = Constants.SCHEME_FILE + Path.GetFullPath(Application.dataPath) + MAC_DATA_DIRECTORY + Constants.PASSPORT_DATA_DIRECTORY_NAME + Constants.PASSPORT_HTML_FILE_NAME;
#else
string filePath = Constants.SCHEME_FILE + Path.GetFullPath(Application.dataPath) + Constants.PASSPORT_DATA_DIRECTORY_NAME + Constants.PASSPORT_HTML_FILE_NAME;
#endif
Debug.Log($"Loading URL: {filePath}");
webViewObject.LoadURL(filePath);
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 70bc662

Please sign in to comment.