diff --git a/sample/Assets/Scripts/UnauthenticatedScript.cs b/sample/Assets/Scripts/UnauthenticatedScript.cs index 4285ad4b..e6dd941d 100644 --- a/sample/Assets/Scripts/UnauthenticatedScript.cs +++ b/sample/Assets/Scripts/UnauthenticatedScript.cs @@ -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 @@ -86,7 +86,8 @@ public async void Connect() ShowOutput("Called Connect()..."); connectButton.gameObject.SetActive(false); -#if UNITY_ANDROID || UNITY_IPHONE || UNITY_STANDALONE_OSX + // macOS editor (play scene) does not support deeplinking +#if UNITY_ANDROID || UNITY_IPHONE || (UNITY_STANDALONE_OSX && !UNITY_EDITOR_OSX) await passport.ConnectPKCE(); #else await passport.Connect(); diff --git a/src/Packages/Passport/Runtime/Scripts/Public/Passport.cs b/src/Packages/Passport/Runtime/Scripts/Public/Passport.cs index 7dc2f0c8..671f7e43 100644 --- a/src/Packages/Passport/Runtime/Scripts/Public/Passport.cs +++ b/src/Packages/Passport/Runtime/Scripts/Public/Passport.cs @@ -52,7 +52,7 @@ private Passport() /// (Currently, mobile only) The URL to which auth will redirect the browser after authorisation has been granted by the user /// (Windows only) Timeout time for waiting for the engine to start (in milliseconds) public static UniTask 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 @@ -61,10 +61,11 @@ public static UniTask 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 ) @@ -94,7 +95,7 @@ public static UniTask 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 ) diff --git a/src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/GreeBrowserClient.cs b/src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/GreeBrowserClient.cs index 96a83899..90429ca5 100644 --- a/src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/GreeBrowserClient.cs +++ b/src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/GreeBrowserClient.cs @@ -9,6 +9,7 @@ public class GreeBrowserClient : IWebBrowserClient private const string TAG = "[GreeBrowserClient]"; private const string ANDROID_DATA_DIRECTORY = "android_asset"; private const string MAC_DATA_DIRECTORY = "/Resources/Data"; + private const string MAC_EDITOR_RESOURCES_DIRECTORY = "/../src/Packages/Passport/Runtime/Resources"; private readonly WebViewObject webViewObject; public event OnUnityPostMessageDelegate OnUnityPostMessage; public event OnUnityPostMessageDelegate OnAuthPostMessage; @@ -25,7 +26,9 @@ 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 +#elif UNITY_EDITOR_OSX + string filePath = Constants.SCHEME_FILE + Path.GetDirectoryName(Application.dataPath) + MAC_EDITOR_RESOURCES_DIRECTORY + Constants.PASSPORT_HTML_FILE_NAME; +#elif UNITY_STANDALONE_OSX 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; diff --git a/src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/WebView.bundle.meta b/src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/WebView.bundle.meta index 1165b4f0..a612f36b 100644 --- a/src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/WebView.bundle.meta +++ b/src/Packages/Passport/Runtime/ThirdParty/Gree/Assets/Plugins/WebView.bundle.meta @@ -6,11 +6,29 @@ PluginImporter: iconMap: {} executionOrder: {} defineConstraints: [] - isPreloaded: 0 + isPreloaded: 1 isOverridable: 1 isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 0 + Exclude Linux64: 1 + Exclude OSXUniversal: 0 + Exclude Win: 1 + Exclude Win64: 1 + Exclude iOS: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + CPU: ARMv7 - first: Any: second: @@ -21,13 +39,42 @@ PluginImporter: second: enabled: 1 settings: + CPU: AnyCPU DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: x86_64 - first: Standalone: OSXUniversal second: enabled: 1 settings: CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + iPhone: iOS + second: + enabled: 0 + settings: + AddToEmbeddedBinaries: false + CPU: AnyCPU + CompileFlags: + FrameworkDependencies: userData: assetBundleName: assetBundleVariant: