@@ -10,6 +10,16 @@ namespace AppleAuth
1010{
1111 public class AppleAuthManager : IAppleAuthManager
1212 {
13+ static AppleAuthManager ( )
14+ {
15+ const string versionMessage = "Using Sign in with Apple Unity Plugin - v1.3.0" ;
16+ #if APPLE_AUTH_MANAGER_NATIVE_IMPLEMENTATION_AVAILABLE
17+ PInvoke . AppleAuth_LogMessage ( versionMessage ) ;
18+ #else
19+ UnityEngine . Debug . Log ( versionMessage ) ;
20+ #endif
21+ }
22+
1323#if APPLE_AUTH_MANAGER_NATIVE_IMPLEMENTATION_AVAILABLE
1424 private readonly IPayloadDeserializer _payloadDeserializer ;
1525
@@ -47,6 +57,7 @@ public void QuickLogin(
4757 {
4858#if APPLE_AUTH_MANAGER_NATIVE_IMPLEMENTATION_AVAILABLE
4959 var nonce = quickLoginArgs . Nonce ;
60+ var state = quickLoginArgs . State ;
5061 var requestId = CallbackHandler . AddMessageCallback (
5162 true ,
5263 payload =>
@@ -60,7 +71,7 @@ public void QuickLogin(
6071 successCallback ( response . AppleIDCredential ) ;
6172 } ) ;
6273
63- PInvoke . AppleAuth_QuickLogin ( requestId , nonce ) ;
74+ PInvoke . AppleAuth_QuickLogin ( requestId , nonce , state ) ;
6475#else
6576 throw new Exception ( "AppleAuthManager is not supported in this platform" ) ;
6677#endif
@@ -79,6 +90,7 @@ public void LoginWithAppleId(
7990#if APPLE_AUTH_MANAGER_NATIVE_IMPLEMENTATION_AVAILABLE
8091 var loginOptions = loginArgs . Options ;
8192 var nonce = loginArgs . Nonce ;
93+ var state = loginArgs . State ;
8294 var requestId = CallbackHandler . AddMessageCallback (
8395 true ,
8496 payload =>
@@ -90,7 +102,7 @@ public void LoginWithAppleId(
90102 successCallback ( response . AppleIDCredential ) ;
91103 } ) ;
92104
93- PInvoke . AppleAuth_LoginWithAppleId ( requestId , ( int ) loginOptions , nonce ) ;
105+ PInvoke . AppleAuth_LoginWithAppleId ( requestId , ( int ) loginOptions , nonce , state ) ;
94106#else
95107 throw new Exception ( "AppleAuthManager is not supported in this platform" ) ;
96108#endif
@@ -310,13 +322,16 @@ public static void NativeMessageHandlerCallback(uint requestId, string payload)
310322 public static extern void AppleAuth_GetCredentialState ( uint requestId , string userId ) ;
311323
312324 [ System . Runtime . InteropServices . DllImport ( DllName ) ]
313- public static extern void AppleAuth_LoginWithAppleId ( uint requestId , int loginOptions , string nonceCStr ) ;
325+ public static extern void AppleAuth_LoginWithAppleId ( uint requestId , int loginOptions , string nonceCStr , string stateCStr ) ;
314326
315327 [ System . Runtime . InteropServices . DllImport ( DllName ) ]
316- public static extern void AppleAuth_QuickLogin ( uint requestId , string nonceCStr ) ;
328+ public static extern void AppleAuth_QuickLogin ( uint requestId , string nonceCStr , string stateCStr ) ;
317329
318330 [ System . Runtime . InteropServices . DllImport ( DllName ) ]
319331 public static extern void AppleAuth_RegisterCredentialsRevokedCallbackId ( uint callbackId ) ;
332+
333+ [ System . Runtime . InteropServices . DllImport ( DllName ) ]
334+ public static extern void AppleAuth_LogMessage ( string messageCStr ) ;
320335 }
321336#endif
322337 }
0 commit comments