@@ -102,6 +102,18 @@ public LootLockerXboxOneSessionRequest(string xbox_user_token)
102
102
this . xbox_user_token = xbox_user_token ;
103
103
}
104
104
}
105
+
106
+ public class LootLockerAppleSignInSessionRequest : LootLockerGetRequest
107
+ {
108
+ public string game_key => LootLockerConfig . current . apiKey ? . ToString ( ) ;
109
+ public string apple_user_token { get ; private set ; }
110
+ public string game_version => LootLockerConfig . current . game_version ;
111
+ public bool development_mode => LootLockerConfig . current . developmentMode ;
112
+ public LootLockerAppleSignInSessionRequest ( string apple_user_token )
113
+ {
114
+ this . apple_user_token = apple_user_token ;
115
+ }
116
+ }
105
117
}
106
118
107
119
namespace LootLocker
@@ -241,6 +253,34 @@ public static void XboxOneSession(LootLockerXboxOneSessionRequest data, Action<L
241
253
} , false ) ;
242
254
}
243
255
256
+ public static void AppleSession ( LootLockerAppleSignInSessionRequest data , Action < LootLockerSessionResponse > onComplete )
257
+ {
258
+ EndPointClass endPoint = LootLockerEndPoints . appleSessionRequest ;
259
+
260
+ string json = "" ;
261
+ if ( data == null )
262
+ {
263
+ return ;
264
+ }
265
+
266
+ json = JsonConvert . SerializeObject ( data ) ;
267
+ LootLockerServerRequest . CallAPI ( endPoint . endPoint , endPoint . httpMethod , json , ( serverResponse ) =>
268
+ {
269
+ LootLockerSessionResponse response = new LootLockerSessionResponse ( ) ;
270
+ if ( string . IsNullOrEmpty ( serverResponse . Error ) )
271
+ {
272
+ response = JsonConvert . DeserializeObject < LootLockerSessionResponse > ( serverResponse . text ) ;
273
+ LootLockerConfig . current . UpdateToken ( response . session_token , "" ) ;
274
+ }
275
+
276
+ response . text = serverResponse . text ;
277
+ response . success = serverResponse . success ;
278
+ response . Error = serverResponse . Error ; response . statusCode = serverResponse . statusCode ;
279
+ onComplete ? . Invoke ( response ) ;
280
+
281
+ } , false ) ;
282
+ }
283
+
244
284
public static void EndSession ( LootLockerGetRequest data , Action < LootLockerSessionResponse > onComplete )
245
285
{
246
286
EndPointClass endPoint = LootLockerEndPoints . endingSession ;
0 commit comments