@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121if ( ! PlayFab . _internalSettings ) {
2222 PlayFab . _internalSettings = {
2323 entityToken : null ,
24- sdkVersion : "1.60.200218 " ,
24+ sdkVersion : "1.61.200303 " ,
2525 requestGetParams : {
26- sdk : "JavaScriptSDK-1.60.200218 "
26+ sdk : "JavaScriptSDK-1.61.200303 "
2727 } ,
2828 sessionTicket : null ,
2929 verticalName : null , // The name of a customer vertical. This is only for customers running a private cluster. Generally you shouldn't touch this
@@ -231,8 +231,8 @@ if(!PlayFab._internalSettings) {
231231 }
232232}
233233
234- PlayFab . buildIdentifier = "jbuild_javascriptsdk__sdk-genericslave-3_0 " ;
235- PlayFab . sdkVersion = "1.60.200218 " ;
234+ PlayFab . buildIdentifier = "jbuild_javascriptsdk__sdk-genericslave-3_2 " ;
235+ PlayFab . sdkVersion = "1.61.200303 " ;
236236PlayFab . GenerateErrorReport = function ( error ) {
237237 if ( error == null )
238238 return "" ;
@@ -544,6 +544,10 @@ PlayFab.ClientApi = {
544544 return PlayFab . _internalSettings . ExecuteRequestWrapper ( "/Client/LinkAndroidDeviceID" , request , "X-Authorization" , callback , customData , extraHeaders ) ;
545545 } ,
546546
547+ LinkApple : function ( request , callback , customData , extraHeaders ) {
548+ return PlayFab . _internalSettings . ExecuteRequestWrapper ( "/Client/LinkApple" , request , "X-Authorization" , callback , customData , extraHeaders ) ;
549+ } ,
550+
547551 LinkCustomID : function ( request , callback , customData , extraHeaders ) {
548552 return PlayFab . _internalSettings . ExecuteRequestWrapper ( "/Client/LinkCustomID" , request , "X-Authorization" , callback , customData , extraHeaders ) ;
549553 } ,
@@ -625,6 +629,31 @@ PlayFab.ClientApi = {
625629 return new Promise ( function ( resolve ) { resolve ( authenticationContext ) ; } ) ;
626630 } ,
627631
632+ LoginWithApple : function ( request , callback , customData , extraHeaders ) {
633+ request . TitleId = PlayFab . settings . titleId ? PlayFab . settings . titleId : request . TitleId ; if ( ! request . TitleId ) throw PlayFab . _internalSettings . errorTitleId ;
634+ // PlayFab._internalSettings.authenticationContext can be modified by other asynchronous login attempts
635+ // Deep-copy the authenticationContext here to safely update it
636+ var authenticationContext = JSON . parse ( JSON . stringify ( PlayFab . _internalSettings . authenticationContext ) ) ;
637+ var overloadCallback = function ( result , error ) {
638+ if ( result != null ) {
639+ if ( result . data . SessionTicket != null ) {
640+ PlayFab . _internalSettings . sessionTicket = result . data . SessionTicket ;
641+ }
642+ if ( result . data . EntityToken != null ) {
643+ PlayFab . _internalSettings . entityToken = result . data . EntityToken . EntityToken ;
644+ }
645+ // Apply the updates for the AuthenticationContext returned to the client
646+ authenticationContext = PlayFab . _internalSettings . UpdateAuthenticationContext ( authenticationContext , result ) ;
647+ PlayFab . ClientApi . _MultiStepClientLogin ( result . data . SettingsForUser . NeedsAttribution ) ;
648+ }
649+ if ( callback != null && typeof ( callback ) === "function" )
650+ callback ( result , error ) ;
651+ } ;
652+ PlayFab . _internalSettings . ExecuteRequestWrapper ( "/Client/LoginWithApple" , request , null , overloadCallback , customData , extraHeaders ) ;
653+ // Return a Promise so that multiple asynchronous calls to this method can be handled simultaneously with Promise.all()
654+ return new Promise ( function ( resolve ) { resolve ( authenticationContext ) ; } ) ;
655+ } ,
656+
628657 LoginWithCustomID : function ( request , callback , customData , extraHeaders ) {
629658 request . TitleId = PlayFab . settings . titleId ? PlayFab . settings . titleId : request . TitleId ; if ( ! request . TitleId ) throw PlayFab . _internalSettings . errorTitleId ;
630659 // PlayFab._internalSettings.authenticationContext can be modified by other asynchronous login attempts
@@ -1150,6 +1179,10 @@ PlayFab.ClientApi = {
11501179 return PlayFab . _internalSettings . ExecuteRequestWrapper ( "/Client/UnlinkAndroidDeviceID" , request , "X-Authorization" , callback , customData , extraHeaders ) ;
11511180 } ,
11521181
1182+ UnlinkApple : function ( request , callback , customData , extraHeaders ) {
1183+ return PlayFab . _internalSettings . ExecuteRequestWrapper ( "/Client/UnlinkApple" , request , "X-Authorization" , callback , customData , extraHeaders ) ;
1184+ } ,
1185+
11531186 UnlinkCustomID : function ( request , callback , customData , extraHeaders ) {
11541187 return PlayFab . _internalSettings . ExecuteRequestWrapper ( "/Client/UnlinkCustomID" , request , "X-Authorization" , callback , customData , extraHeaders ) ;
11551188 } ,
0 commit comments