Skip to content

Commit 2f18b25

Browse files
committed
fix: compilation flags
1 parent 2cddcb0 commit 2f18b25

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

sample/Assets/Scripts/UnauthenticatedScript.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ public async void Login()
6565
// Login using the appropriate login method
6666
if (SampleAppManager.SupportsPKCE && SampleAppManager.UsePKCE)
6767
{
68+
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
6869
await Passport.LoginPKCE();
70+
#endif
6971
}
7072
else
7173
{
@@ -105,7 +107,9 @@ public async void Connect()
105107
// Login and connect to IMX using the appropriate connect method
106108
if (SampleAppManager.SupportsPKCE && SampleAppManager.UsePKCE)
107109
{
110+
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
108111
await Passport.ConnectImxPKCE();
112+
#endif
109113
}
110114
else
111115
{
@@ -200,7 +204,9 @@ private async UniTask Logout()
200204
// Logout using the appropriate logout method
201205
if (SampleAppManager.SupportsPKCE && SampleAppManager.UsePKCE)
202206
{
207+
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
203208
await Passport.LogoutPKCE();
209+
#endif
204210
}
205211
else
206212
{

src/Packages/Passport/Runtime/Scripts/Public/Passport.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public async UniTask<bool> ConnectImx(bool useCachedSession = false, Nullable<lo
166166
return await GetPassportImpl().ConnectImx(useCachedSession, timeoutMs);
167167
}
168168

169-
#if UNITY_ANDROID || UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
169+
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
170170
/// <summary>
171171
/// Connects the user into Passport via PKCE auth.
172172
/// </summary>
@@ -208,6 +208,7 @@ public async UniTask Logout(bool hardLogout = true)
208208
await GetPassportImpl().Logout(hardLogout);
209209
}
210210

211+
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
211212
/// <summary>
212213
/// Logs the user out of Passport and removes any stored credentials.
213214
/// Recommended to use when logging in using PKCE flow - ConnectImxPKCE()
@@ -217,6 +218,7 @@ public async UniTask LogoutPKCE(bool hardLogout = true)
217218
{
218219
await GetPassportImpl().LogoutPKCE(hardLogout);
219220
}
221+
#endif
220222

221223
/// <summary>
222224
/// Checks if credentials exist but does not check if they're valid

0 commit comments

Comments
 (0)