@@ -33,6 +33,8 @@ public static class PlayFabClientAPI
33
33
public delegate void LoginWithPlayFabResponseCallback ( string urlPath , int callId , LoginWithPlayFabRequest request , LoginResult result , PlayFabError error , object customData ) ;
34
34
public delegate void LoginWithSteamRequestCallback ( string urlPath , int callId , LoginWithSteamRequest request , object customData ) ;
35
35
public delegate void LoginWithSteamResponseCallback ( string urlPath , int callId , LoginWithSteamRequest request , LoginResult result , PlayFabError error , object customData ) ;
36
+ public delegate void LoginWithTwitchRequestCallback ( string urlPath , int callId , LoginWithTwitchRequest request , object customData ) ;
37
+ public delegate void LoginWithTwitchResponseCallback ( string urlPath , int callId , LoginWithTwitchRequest request , LoginResult result , PlayFabError error , object customData ) ;
36
38
public delegate void RegisterPlayFabUserRequestCallback ( string urlPath , int callId , RegisterPlayFabUserRequest request , object customData ) ;
37
39
public delegate void RegisterPlayFabUserResponseCallback ( string urlPath , int callId , RegisterPlayFabUserRequest request , RegisterPlayFabUserResult result , PlayFabError error , object customData ) ;
38
40
public delegate void AddUsernamePasswordRequestCallback ( string urlPath , int callId , AddUsernamePasswordRequest request , object customData ) ;
@@ -51,6 +53,8 @@ public static class PlayFabClientAPI
51
53
public delegate void GetPlayFabIDsFromKongregateIDsResponseCallback ( string urlPath , int callId , GetPlayFabIDsFromKongregateIDsRequest request , GetPlayFabIDsFromKongregateIDsResult result , PlayFabError error , object customData ) ;
52
54
public delegate void GetPlayFabIDsFromSteamIDsRequestCallback ( string urlPath , int callId , GetPlayFabIDsFromSteamIDsRequest request , object customData ) ;
53
55
public delegate void GetPlayFabIDsFromSteamIDsResponseCallback ( string urlPath , int callId , GetPlayFabIDsFromSteamIDsRequest request , GetPlayFabIDsFromSteamIDsResult result , PlayFabError error , object customData ) ;
56
+ public delegate void GetPlayFabIDsFromTwitchIDsRequestCallback ( string urlPath , int callId , GetPlayFabIDsFromTwitchIDsRequest request , object customData ) ;
57
+ public delegate void GetPlayFabIDsFromTwitchIDsResponseCallback ( string urlPath , int callId , GetPlayFabIDsFromTwitchIDsRequest request , GetPlayFabIDsFromTwitchIDsResult result , PlayFabError error , object customData ) ;
54
58
public delegate void GetUserCombinedInfoRequestCallback ( string urlPath , int callId , GetUserCombinedInfoRequest request , object customData ) ;
55
59
public delegate void GetUserCombinedInfoResponseCallback ( string urlPath , int callId , GetUserCombinedInfoRequest request , GetUserCombinedInfoResult result , PlayFabError error , object customData ) ;
56
60
public delegate void LinkAndroidDeviceIDRequestCallback ( string urlPath , int callId , LinkAndroidDeviceIDRequest request , object customData ) ;
@@ -69,6 +73,8 @@ public static class PlayFabClientAPI
69
73
public delegate void LinkKongregateResponseCallback ( string urlPath , int callId , LinkKongregateAccountRequest request , LinkKongregateAccountResult result , PlayFabError error , object customData ) ;
70
74
public delegate void LinkSteamAccountRequestCallback ( string urlPath , int callId , LinkSteamAccountRequest request , object customData ) ;
71
75
public delegate void LinkSteamAccountResponseCallback ( string urlPath , int callId , LinkSteamAccountRequest request , LinkSteamAccountResult result , PlayFabError error , object customData ) ;
76
+ public delegate void LinkTwitchRequestCallback ( string urlPath , int callId , LinkTwitchAccountRequest request , object customData ) ;
77
+ public delegate void LinkTwitchResponseCallback ( string urlPath , int callId , LinkTwitchAccountRequest request , LinkTwitchAccountResult result , PlayFabError error , object customData ) ;
72
78
public delegate void ReportPlayerRequestCallback ( string urlPath , int callId , ReportPlayerClientRequest request , object customData ) ;
73
79
public delegate void ReportPlayerResponseCallback ( string urlPath , int callId , ReportPlayerClientRequest request , ReportPlayerClientResult result , PlayFabError error , object customData ) ;
74
80
public delegate void SendAccountRecoveryEmailRequestCallback ( string urlPath , int callId , SendAccountRecoveryEmailRequest request , object customData ) ;
@@ -89,6 +95,8 @@ public static class PlayFabClientAPI
89
95
public delegate void UnlinkKongregateResponseCallback ( string urlPath , int callId , UnlinkKongregateAccountRequest request , UnlinkKongregateAccountResult result , PlayFabError error , object customData ) ;
90
96
public delegate void UnlinkSteamAccountRequestCallback ( string urlPath , int callId , UnlinkSteamAccountRequest request , object customData ) ;
91
97
public delegate void UnlinkSteamAccountResponseCallback ( string urlPath , int callId , UnlinkSteamAccountRequest request , UnlinkSteamAccountResult result , PlayFabError error , object customData ) ;
98
+ public delegate void UnlinkTwitchRequestCallback ( string urlPath , int callId , UnlinkTwitchAccountRequest request , object customData ) ;
99
+ public delegate void UnlinkTwitchResponseCallback ( string urlPath , int callId , UnlinkTwitchAccountRequest request , UnlinkTwitchAccountResult result , PlayFabError error , object customData ) ;
92
100
public delegate void UpdateUserTitleDisplayNameRequestCallback ( string urlPath , int callId , UpdateUserTitleDisplayNameRequest request , object customData ) ;
93
101
public delegate void UpdateUserTitleDisplayNameResponseCallback ( string urlPath , int callId , UpdateUserTitleDisplayNameRequest request , UpdateUserTitleDisplayNameResult result , PlayFabError error , object customData ) ;
94
102
public delegate void GetFriendLeaderboardRequestCallback ( string urlPath , int callId , GetFriendLeaderboardRequest request , object customData ) ;
@@ -483,6 +491,28 @@ public static void LoginWithSteamResultAction(LoginResult result, CallRequestCon
483
491
484
492
}
485
493
494
+ /// <summary>
495
+ /// Signs the user in using a Twitch access token.
496
+ /// </summary>
497
+ public static void LoginWithTwitch ( LoginWithTwitchRequest request , PlayFabResultCommon . ProcessApiCallback < LoginResult > resultCallback , ErrorCallback errorCallback , object customData = null )
498
+ {
499
+ request . TitleId = request . TitleId ?? PlayFabSettings . TitleId ;
500
+ if ( request . TitleId == null ) throw new Exception ( "Must be have PlayFabSettings.TitleId set to call this method" ) ;
501
+
502
+ string serializedJson = JsonWrapper . SerializeObject ( request , PlayFabUtil . ApiSerializerStrategy ) ;
503
+ Action < CallRequestContainer > callback = delegate ( CallRequestContainer requestContainer )
504
+ {
505
+ ResultContainer < LoginResult > . HandleResults ( requestContainer , resultCallback , errorCallback , LoginWithTwitchResultAction ) ;
506
+ } ;
507
+ PlayFabHttp . Post ( "/Client/LoginWithTwitch" , serializedJson , null , null , callback , request , customData ) ;
508
+ }
509
+ public static void LoginWithTwitchResultAction ( LoginResult result , CallRequestContainer requestContainer )
510
+ {
511
+ _authKey = result . SessionTicket ?? _authKey ;
512
+ MultiStepClientLogin ( result . SettingsForUser . NeedsAttribution ) ;
513
+
514
+ }
515
+
486
516
/// <summary>
487
517
/// Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply either a username or an email address.
488
518
/// </summary>
@@ -625,6 +655,21 @@ public static void GetPlayFabIDsFromSteamIDs(GetPlayFabIDsFromSteamIDsRequest re
625
655
PlayFabHttp . Post ( "/Client/GetPlayFabIDsFromSteamIDs" , serializedJson , "X-Authorization" , _authKey , callback , request , customData ) ;
626
656
}
627
657
658
+ /// <summary>
659
+ /// Retrieves the unique PlayFab identifiers for the given set of Twitch identifiers. The Twitch identifiers are the IDs for the user accounts, available as "_id" from the Twitch API methods(ex: https://github.com/justintv/Twitch-API/blob/master/v3_resources/users.md#get-usersuser).
660
+ /// </summary>
661
+ public static void GetPlayFabIDsFromTwitchIDs ( GetPlayFabIDsFromTwitchIDsRequest request , PlayFabResultCommon . ProcessApiCallback < GetPlayFabIDsFromTwitchIDsResult > resultCallback , ErrorCallback errorCallback , object customData = null )
662
+ {
663
+ if ( _authKey == null ) throw new Exception ( "Must be logged in to call this method" ) ;
664
+
665
+ string serializedJson = JsonWrapper . SerializeObject ( request , PlayFabUtil . ApiSerializerStrategy ) ;
666
+ Action < CallRequestContainer > callback = delegate ( CallRequestContainer requestContainer )
667
+ {
668
+ ResultContainer < GetPlayFabIDsFromTwitchIDsResult > . HandleResults ( requestContainer , resultCallback , errorCallback , null ) ;
669
+ } ;
670
+ PlayFabHttp . Post ( "/Client/GetPlayFabIDsFromTwitchIDs" , serializedJson , "X-Authorization" , _authKey , callback , request , customData ) ;
671
+ }
672
+
628
673
/// <summary>
629
674
/// NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user.
630
675
/// </summary>
@@ -760,6 +805,21 @@ public static void LinkSteamAccount(LinkSteamAccountRequest request, PlayFabResu
760
805
PlayFabHttp . Post ( "/Client/LinkSteamAccount" , serializedJson , "X-Authorization" , _authKey , callback , request , customData ) ;
761
806
}
762
807
808
+ /// <summary>
809
+ /// Links the Twitch account associated with the token to the user's PlayFab account
810
+ /// </summary>
811
+ public static void LinkTwitch ( LinkTwitchAccountRequest request , PlayFabResultCommon . ProcessApiCallback < LinkTwitchAccountResult > resultCallback , ErrorCallback errorCallback , object customData = null )
812
+ {
813
+ if ( _authKey == null ) throw new Exception ( "Must be logged in to call this method" ) ;
814
+
815
+ string serializedJson = JsonWrapper . SerializeObject ( request , PlayFabUtil . ApiSerializerStrategy ) ;
816
+ Action < CallRequestContainer > callback = delegate ( CallRequestContainer requestContainer )
817
+ {
818
+ ResultContainer < LinkTwitchAccountResult > . HandleResults ( requestContainer , resultCallback , errorCallback , null ) ;
819
+ } ;
820
+ PlayFabHttp . Post ( "/Client/LinkTwitch" , serializedJson , "X-Authorization" , _authKey , callback , request , customData ) ;
821
+ }
822
+
763
823
/// <summary>
764
824
/// Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players.
765
825
/// </summary>
@@ -909,6 +969,21 @@ public static void UnlinkSteamAccount(UnlinkSteamAccountRequest request, PlayFab
909
969
PlayFabHttp . Post ( "/Client/UnlinkSteamAccount" , serializedJson , "X-Authorization" , _authKey , callback , request , customData ) ;
910
970
}
911
971
972
+ /// <summary>
973
+ /// Unlinks the related Twitch account from the user's PlayFab account
974
+ /// </summary>
975
+ public static void UnlinkTwitch ( UnlinkTwitchAccountRequest request , PlayFabResultCommon . ProcessApiCallback < UnlinkTwitchAccountResult > resultCallback , ErrorCallback errorCallback , object customData = null )
976
+ {
977
+ if ( _authKey == null ) throw new Exception ( "Must be logged in to call this method" ) ;
978
+
979
+ string serializedJson = JsonWrapper . SerializeObject ( request , PlayFabUtil . ApiSerializerStrategy ) ;
980
+ Action < CallRequestContainer > callback = delegate ( CallRequestContainer requestContainer )
981
+ {
982
+ ResultContainer < UnlinkTwitchAccountResult > . HandleResults ( requestContainer , resultCallback , errorCallback , null ) ;
983
+ } ;
984
+ PlayFabHttp . Post ( "/Client/UnlinkTwitch" , serializedJson , "X-Authorization" , _authKey , callback , request , customData ) ;
985
+ }
986
+
912
987
/// <summary>
913
988
/// Updates the title specific display name for the user
914
989
/// </summary>
0 commit comments