diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java index 160a762b..2c9a0887 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java @@ -5575,192 +5575,6 @@ private static PlayFabResult privateSetFriendTagsAsync(fina return pfResult; } - /** - * Registers the iOS device to receive push notifications - * @param request RegisterForIOSPushNotificationRequest - * @return Async Task will return RegisterForIOSPushNotificationResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> RegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRegisterForIOSPushNotificationAsync(request); - } - }); - } - - /** - * Registers the iOS device to receive push notifications - * @param request RegisterForIOSPushNotificationRequest - * @return RegisterForIOSPushNotificationResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult RegisterForIOSPushNotification(final RegisterForIOSPushNotificationRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRegisterForIOSPushNotificationAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Registers the iOS device to receive push notifications - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - RegisterForIOSPushNotificationResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Restores all in-app purchases based on the given restore receipt - * @param request RestoreIOSPurchasesRequest - * @return Async Task will return RestoreIOSPurchasesResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> RestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRestoreIOSPurchasesAsync(request); - } - }); - } - - /** - * Restores all in-app purchases based on the given restore receipt - * @param request RestoreIOSPurchasesRequest - * @return RestoreIOSPurchasesResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult RestoreIOSPurchases(final RestoreIOSPurchasesRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRestoreIOSPurchasesAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Restores all in-app purchases based on the given restore receipt - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - RestoreIOSPurchasesResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateIOSReceiptRequest - * @return Async Task will return ValidateIOSReceiptResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> ValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateIOSReceiptAsync(request); - } - }); - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateIOSReceiptRequest - * @return ValidateIOSReceiptResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult ValidateIOSReceipt(final ValidateIOSReceiptRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateIOSReceiptAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateIOSReceiptResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - /** * Get details about all current running game servers matching the given parameters. * @param request CurrentGamesRequest @@ -6010,29 +5824,29 @@ private static PlayFabResult privateStartGameAsync(final StartG } /** - * Registers the Android device to receive push notifications - * @param request AndroidDevicePushNotificationRegistrationRequest - * @return Async Task will return AndroidDevicePushNotificationRegistrationResult + * Writes a character-based event into PlayStream. + * @param request WriteClientCharacterEventRequest + * @return Async Task will return WriteEventResponse */ @SuppressWarnings("unchecked") - public static FutureTask> AndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAndroidDevicePushNotificationRegistrationAsync(request); + public static FutureTask> WriteCharacterEventAsync(final WriteClientCharacterEventRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWriteCharacterEventAsync(request); } }); } /** - * Registers the Android device to receive push notifications - * @param request AndroidDevicePushNotificationRegistrationRequest - * @return AndroidDevicePushNotificationRegistrationResult + * Writes a character-based event into PlayStream. + * @param request WriteClientCharacterEventRequest + * @return WriteEventResponse */ @SuppressWarnings("unchecked") - public static PlayFabResult AndroidDevicePushNotificationRegistration(final AndroidDevicePushNotificationRegistrationRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAndroidDevicePushNotificationRegistrationAsync(request); + public static PlayFabResult WriteCharacterEvent(final WriteClientCharacterEventRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWriteCharacterEventAsync(request); } }); try { @@ -6044,181 +5858,57 @@ public PlayFabResult call() thr } /** - * Registers the Android device to receive push notifications + * Writes a character-based event into PlayStream. */ @SuppressWarnings("unchecked") - private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { + private static PlayFabResult privateWriteCharacterEventAsync(final WriteClientCharacterEventRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/WriteCharacterEvent", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { PlayFabError error = (PlayFabError)httpResult; if (PlayFabSettings.GlobalErrorHandler != null) PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); + PlayFabResult result = new PlayFabResult(); result.Error = error; return result; } String resultRawJson = (String) httpResult; - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - AndroidDevicePushNotificationRegistrationResult result = resultData.data; + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + WriteEventResponse result = resultData.data; - PlayFabResult pfResult = new PlayFabResult(); + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } /** - * Validates a Google Play purchase and gives the corresponding item to the player. - * @param request ValidateGooglePlayPurchaseRequest - * @return Async Task will return ValidateGooglePlayPurchaseResult + * Writes a player-based event into PlayStream. + * @param request WriteClientPlayerEventRequest + * @return Async Task will return WriteEventResponse */ @SuppressWarnings("unchecked") - public static FutureTask> ValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateGooglePlayPurchaseAsync(request); + public static FutureTask> WritePlayerEventAsync(final WriteClientPlayerEventRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWritePlayerEventAsync(request); } }); } /** - * Validates a Google Play purchase and gives the corresponding item to the player. - * @param request ValidateGooglePlayPurchaseRequest - * @return ValidateGooglePlayPurchaseResult + * Writes a player-based event into PlayStream. + * @param request WriteClientPlayerEventRequest + * @return WriteEventResponse */ @SuppressWarnings("unchecked") - public static PlayFabResult ValidateGooglePlayPurchase(final ValidateGooglePlayPurchaseRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateGooglePlayPurchaseAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates a Google Play purchase and gives the corresponding item to the player. - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateGooglePlayPurchaseResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Writes a character-based event into PlayStream. - * @param request WriteClientCharacterEventRequest - * @return Async Task will return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static FutureTask> WriteCharacterEventAsync(final WriteClientCharacterEventRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWriteCharacterEventAsync(request); - } - }); - } - - /** - * Writes a character-based event into PlayStream. - * @param request WriteClientCharacterEventRequest - * @return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static PlayFabResult WriteCharacterEvent(final WriteClientCharacterEventRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWriteCharacterEventAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Writes a character-based event into PlayStream. - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateWriteCharacterEventAsync(final WriteClientCharacterEventRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/WriteCharacterEvent", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - WriteEventResponse result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Writes a player-based event into PlayStream. - * @param request WriteClientPlayerEventRequest - * @return Async Task will return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static FutureTask> WritePlayerEventAsync(final WriteClientPlayerEventRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWritePlayerEventAsync(request); - } - }); - } - - /** - * Writes a player-based event into PlayStream. - * @param request WriteClientPlayerEventRequest - * @return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static PlayFabResult WritePlayerEvent(final WriteClientPlayerEventRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWritePlayerEventAsync(request); + public static PlayFabResult WritePlayerEvent(final WriteClientPlayerEventRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWritePlayerEventAsync(request); } }); try { @@ -7373,68 +7063,6 @@ private static PlayFabResult privateUpdateCharacterDa return pfResult; } - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateAmazonReceiptRequest - * @return Async Task will return ValidateAmazonReceiptResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateAmazonIAPReceiptAsync(request); - } - }); - } - - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateAmazonReceiptRequest - * @return ValidateAmazonReceiptResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateAmazonIAPReceiptAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateAmazonReceiptResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - /** * Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. * @param request AcceptTradeRequest @@ -7933,6 +7561,378 @@ private static PlayFabResult privateGetPlayerTagsAsync(fina return pfResult; } + /** + * Registers the Android device to receive push notifications + * @param request AndroidDevicePushNotificationRegistrationRequest + * @return Async Task will return AndroidDevicePushNotificationRegistrationResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> AndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAndroidDevicePushNotificationRegistrationAsync(request); + } + }); + } + + /** + * Registers the Android device to receive push notifications + * @param request AndroidDevicePushNotificationRegistrationRequest + * @return AndroidDevicePushNotificationRegistrationResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AndroidDevicePushNotificationRegistration(final AndroidDevicePushNotificationRegistrationRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAndroidDevicePushNotificationRegistrationAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Registers the Android device to receive push notifications + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + AndroidDevicePushNotificationRegistrationResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Registers the iOS device to receive push notifications + * @param request RegisterForIOSPushNotificationRequest + * @return Async Task will return RegisterForIOSPushNotificationResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> RegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRegisterForIOSPushNotificationAsync(request); + } + }); + } + + /** + * Registers the iOS device to receive push notifications + * @param request RegisterForIOSPushNotificationRequest + * @return RegisterForIOSPushNotificationResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RegisterForIOSPushNotification(final RegisterForIOSPushNotificationRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRegisterForIOSPushNotificationAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Registers the iOS device to receive push notifications + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + RegisterForIOSPushNotificationResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Restores all in-app purchases based on the given restore receipt + * @param request RestoreIOSPurchasesRequest + * @return Async Task will return RestoreIOSPurchasesResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> RestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRestoreIOSPurchasesAsync(request); + } + }); + } + + /** + * Restores all in-app purchases based on the given restore receipt + * @param request RestoreIOSPurchasesRequest + * @return RestoreIOSPurchasesResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RestoreIOSPurchases(final RestoreIOSPurchasesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRestoreIOSPurchasesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Restores all in-app purchases based on the given restore receipt + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + RestoreIOSPurchasesResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateAmazonReceiptRequest + * @return Async Task will return ValidateAmazonReceiptResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateAmazonReceiptRequest + * @return ValidateAmazonReceiptResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateAmazonReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + * @param request ValidateGooglePlayPurchaseRequest + * @return Async Task will return ValidateGooglePlayPurchaseResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateGooglePlayPurchaseAsync(request); + } + }); + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + * @param request ValidateGooglePlayPurchaseRequest + * @return ValidateGooglePlayPurchaseResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateGooglePlayPurchase(final ValidateGooglePlayPurchaseRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateGooglePlayPurchaseAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateGooglePlayPurchaseResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateIOSReceiptRequest + * @return Async Task will return ValidateIOSReceiptResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateIOSReceiptAsync(request); + } + }); + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateIOSReceiptRequest + * @return ValidateIOSReceiptResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateIOSReceipt(final ValidateIOSReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateIOSReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateIOSReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the purchased catalog item * @param request ValidateWindowsReceiptRequest diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java index 27679d24..3649ead6 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java @@ -1451,7 +1451,7 @@ public static class GetFriendLeaderboardAroundPlayerRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1503,7 +1503,7 @@ public static class GetFriendLeaderboardRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1579,7 +1579,7 @@ public static class GetLeaderboardAroundPlayerRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1643,7 +1643,7 @@ public static class GetLeaderboardRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1832,7 +1832,7 @@ public static class GetPlayerProfileRequest { */ public String PlayFabId; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -2334,7 +2334,7 @@ public static class GrantCharacterToUserRequest { */ public String ItemId; /** - * Non-unique display name of the character being granted. + * Non-unique display name of the character being granted (1-20 characters in length). */ public String CharacterName; @@ -3341,11 +3341,11 @@ public static class PlayerProfileModel { */ public String PublisherId; /** - * Title ID this profile applies to + * Title ID this player profile applies to */ public String TitleId; /** - * PlayFab Player ID + * PlayFab player account unique identifier */ public String PlayerId; /** @@ -3357,7 +3357,7 @@ public static class PlayerProfileModel { */ public LoginIdentityProvider Origination; /** - * Last login + * UTC time when the player most recently logged in to the title */ public Date LastLogin; /** @@ -3365,15 +3365,15 @@ public static class PlayerProfileModel { */ public Date BannedUntil; /** - * List of geographic locations where the player has logged-in + * List of geographic locations from which the player has logged in to the title */ public ArrayList Locations; /** - * Player Display Name + * Player display name */ public String DisplayName; /** - * Image URL of the player's avatar + * URL of the player's avatar image */ public String AvatarUrl; /** @@ -3385,7 +3385,7 @@ public static class PlayerProfileModel { */ public ArrayList PushNotificationRegistrations; /** - * List of third party accounts linked to this player + * List of all authentication systems linked to this player account */ public ArrayList LinkedAccounts; /** @@ -3393,15 +3393,15 @@ public static class PlayerProfileModel { */ public ArrayList AdCampaignAttributions; /** - * A sum of player's total purchases across all real-money currencies, converted to US Dollars equivalent + * Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. */ public Long TotalValueToDateInUSD; /** - * List of player's total lifetime real-money purchases by currency + * List of the player's lifetime purchase totals, summed by real-money currency */ public ArrayList ValuesToDate; /** - * List of player's virtual currency balances + * List of the player's virtual currency balances */ public ArrayList VirtualCurrencyBalances; /** @@ -3644,7 +3644,7 @@ public static class RegisterPlayFabUserRequest { */ public Boolean RequireBothUsernameAndEmail; /** - * An optional parameter for setting the display name for this title. + * An optional parameter for setting the display name for this title (3-25 characters). */ public String DisplayName; /** @@ -4906,11 +4906,11 @@ public static class ValueToDateModel { */ public String Currency; /** - * Total value of the purchases in a whole number of 1/100 monetary units. For example 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') */ public Long TotalValue; /** - * Total value of the purchases in a string representation of decimal monetary units (e.g. '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD')) + * Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD'. */ public String TotalValueAsDecimal; diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java index b4789b67..75c85797 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java @@ -4,9 +4,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.50.170530"; - public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.50.170530"; + public static String SdkVersion = "0.51.170612"; + public static String BuildIdentifier = "jbuild_javasdk_1"; + public static String SdkVersionString = "JavaSDK-0.51.170612"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler; diff --git a/PlayFabClientSDK/pom.xml b/PlayFabClientSDK/pom.xml index 58bda05a..5af3c487 100644 --- a/PlayFabClientSDK/pom.xml +++ b/PlayFabClientSDK/pom.xml @@ -4,7 +4,7 @@ 2016 com.playfab client-sdk - 0.50.170530 + 0.51.170612 PlayFab Client API PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. http://api.playfab.com/ diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientAPI.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientAPI.java index 91c5f864..7fb49b9b 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientAPI.java @@ -5574,192 +5574,6 @@ private static PlayFabResult privateSetFriendTagsAsync(fina return pfResult; } - /** - * Registers the iOS device to receive push notifications - * @param request RegisterForIOSPushNotificationRequest - * @return Async Task will return RegisterForIOSPushNotificationResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> RegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRegisterForIOSPushNotificationAsync(request); - } - }); - } - - /** - * Registers the iOS device to receive push notifications - * @param request RegisterForIOSPushNotificationRequest - * @return RegisterForIOSPushNotificationResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult RegisterForIOSPushNotification(final RegisterForIOSPushNotificationRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRegisterForIOSPushNotificationAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Registers the iOS device to receive push notifications - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - RegisterForIOSPushNotificationResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Restores all in-app purchases based on the given restore receipt - * @param request RestoreIOSPurchasesRequest - * @return Async Task will return RestoreIOSPurchasesResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> RestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRestoreIOSPurchasesAsync(request); - } - }); - } - - /** - * Restores all in-app purchases based on the given restore receipt - * @param request RestoreIOSPurchasesRequest - * @return RestoreIOSPurchasesResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult RestoreIOSPurchases(final RestoreIOSPurchasesRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRestoreIOSPurchasesAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Restores all in-app purchases based on the given restore receipt - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - RestoreIOSPurchasesResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateIOSReceiptRequest - * @return Async Task will return ValidateIOSReceiptResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> ValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateIOSReceiptAsync(request); - } - }); - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateIOSReceiptRequest - * @return ValidateIOSReceiptResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult ValidateIOSReceipt(final ValidateIOSReceiptRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateIOSReceiptAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateIOSReceiptResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - /** * Get details about all current running game servers matching the given parameters. * @param request CurrentGamesRequest @@ -6009,29 +5823,29 @@ private static PlayFabResult privateStartGameAsync(final StartG } /** - * Registers the Android device to receive push notifications - * @param request AndroidDevicePushNotificationRegistrationRequest - * @return Async Task will return AndroidDevicePushNotificationRegistrationResult + * Writes a character-based event into PlayStream. + * @param request WriteClientCharacterEventRequest + * @return Async Task will return WriteEventResponse */ @SuppressWarnings("unchecked") - public static FutureTask> AndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAndroidDevicePushNotificationRegistrationAsync(request); + public static FutureTask> WriteCharacterEventAsync(final WriteClientCharacterEventRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWriteCharacterEventAsync(request); } }); } /** - * Registers the Android device to receive push notifications - * @param request AndroidDevicePushNotificationRegistrationRequest - * @return AndroidDevicePushNotificationRegistrationResult + * Writes a character-based event into PlayStream. + * @param request WriteClientCharacterEventRequest + * @return WriteEventResponse */ @SuppressWarnings("unchecked") - public static PlayFabResult AndroidDevicePushNotificationRegistration(final AndroidDevicePushNotificationRegistrationRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAndroidDevicePushNotificationRegistrationAsync(request); + public static PlayFabResult WriteCharacterEvent(final WriteClientCharacterEventRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWriteCharacterEventAsync(request); } }); try { @@ -6043,181 +5857,57 @@ public PlayFabResult call() thr } /** - * Registers the Android device to receive push notifications + * Writes a character-based event into PlayStream. */ @SuppressWarnings("unchecked") - private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { + private static PlayFabResult privateWriteCharacterEventAsync(final WriteClientCharacterEventRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/WriteCharacterEvent", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { PlayFabError error = (PlayFabError)httpResult; if (PlayFabSettings.GlobalErrorHandler != null) PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); + PlayFabResult result = new PlayFabResult(); result.Error = error; return result; } String resultRawJson = (String) httpResult; - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - AndroidDevicePushNotificationRegistrationResult result = resultData.data; + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + WriteEventResponse result = resultData.data; - PlayFabResult pfResult = new PlayFabResult(); + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } /** - * Validates a Google Play purchase and gives the corresponding item to the player. - * @param request ValidateGooglePlayPurchaseRequest - * @return Async Task will return ValidateGooglePlayPurchaseResult + * Writes a player-based event into PlayStream. + * @param request WriteClientPlayerEventRequest + * @return Async Task will return WriteEventResponse */ @SuppressWarnings("unchecked") - public static FutureTask> ValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateGooglePlayPurchaseAsync(request); + public static FutureTask> WritePlayerEventAsync(final WriteClientPlayerEventRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWritePlayerEventAsync(request); } }); } /** - * Validates a Google Play purchase and gives the corresponding item to the player. - * @param request ValidateGooglePlayPurchaseRequest - * @return ValidateGooglePlayPurchaseResult + * Writes a player-based event into PlayStream. + * @param request WriteClientPlayerEventRequest + * @return WriteEventResponse */ @SuppressWarnings("unchecked") - public static PlayFabResult ValidateGooglePlayPurchase(final ValidateGooglePlayPurchaseRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateGooglePlayPurchaseAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates a Google Play purchase and gives the corresponding item to the player. - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateGooglePlayPurchaseResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Writes a character-based event into PlayStream. - * @param request WriteClientCharacterEventRequest - * @return Async Task will return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static FutureTask> WriteCharacterEventAsync(final WriteClientCharacterEventRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWriteCharacterEventAsync(request); - } - }); - } - - /** - * Writes a character-based event into PlayStream. - * @param request WriteClientCharacterEventRequest - * @return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static PlayFabResult WriteCharacterEvent(final WriteClientCharacterEventRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWriteCharacterEventAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Writes a character-based event into PlayStream. - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateWriteCharacterEventAsync(final WriteClientCharacterEventRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/WriteCharacterEvent", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - WriteEventResponse result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Writes a player-based event into PlayStream. - * @param request WriteClientPlayerEventRequest - * @return Async Task will return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static FutureTask> WritePlayerEventAsync(final WriteClientPlayerEventRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWritePlayerEventAsync(request); - } - }); - } - - /** - * Writes a player-based event into PlayStream. - * @param request WriteClientPlayerEventRequest - * @return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static PlayFabResult WritePlayerEvent(final WriteClientPlayerEventRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWritePlayerEventAsync(request); + public static PlayFabResult WritePlayerEvent(final WriteClientPlayerEventRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWritePlayerEventAsync(request); } }); try { @@ -7372,68 +7062,6 @@ private static PlayFabResult privateUpdateCharacterDa return pfResult; } - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateAmazonReceiptRequest - * @return Async Task will return ValidateAmazonReceiptResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateAmazonIAPReceiptAsync(request); - } - }); - } - - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateAmazonReceiptRequest - * @return ValidateAmazonReceiptResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateAmazonIAPReceiptAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateAmazonReceiptResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - /** * Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. * @param request AcceptTradeRequest @@ -7932,6 +7560,378 @@ private static PlayFabResult privateGetPlayerTagsAsync(fina return pfResult; } + /** + * Registers the Android device to receive push notifications + * @param request AndroidDevicePushNotificationRegistrationRequest + * @return Async Task will return AndroidDevicePushNotificationRegistrationResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> AndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAndroidDevicePushNotificationRegistrationAsync(request); + } + }); + } + + /** + * Registers the Android device to receive push notifications + * @param request AndroidDevicePushNotificationRegistrationRequest + * @return AndroidDevicePushNotificationRegistrationResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AndroidDevicePushNotificationRegistration(final AndroidDevicePushNotificationRegistrationRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAndroidDevicePushNotificationRegistrationAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Registers the Android device to receive push notifications + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + AndroidDevicePushNotificationRegistrationResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Registers the iOS device to receive push notifications + * @param request RegisterForIOSPushNotificationRequest + * @return Async Task will return RegisterForIOSPushNotificationResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> RegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRegisterForIOSPushNotificationAsync(request); + } + }); + } + + /** + * Registers the iOS device to receive push notifications + * @param request RegisterForIOSPushNotificationRequest + * @return RegisterForIOSPushNotificationResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RegisterForIOSPushNotification(final RegisterForIOSPushNotificationRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRegisterForIOSPushNotificationAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Registers the iOS device to receive push notifications + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + RegisterForIOSPushNotificationResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Restores all in-app purchases based on the given restore receipt + * @param request RestoreIOSPurchasesRequest + * @return Async Task will return RestoreIOSPurchasesResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> RestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRestoreIOSPurchasesAsync(request); + } + }); + } + + /** + * Restores all in-app purchases based on the given restore receipt + * @param request RestoreIOSPurchasesRequest + * @return RestoreIOSPurchasesResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RestoreIOSPurchases(final RestoreIOSPurchasesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRestoreIOSPurchasesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Restores all in-app purchases based on the given restore receipt + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + RestoreIOSPurchasesResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateAmazonReceiptRequest + * @return Async Task will return ValidateAmazonReceiptResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateAmazonReceiptRequest + * @return ValidateAmazonReceiptResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateAmazonReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + * @param request ValidateGooglePlayPurchaseRequest + * @return Async Task will return ValidateGooglePlayPurchaseResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateGooglePlayPurchaseAsync(request); + } + }); + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + * @param request ValidateGooglePlayPurchaseRequest + * @return ValidateGooglePlayPurchaseResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateGooglePlayPurchase(final ValidateGooglePlayPurchaseRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateGooglePlayPurchaseAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateGooglePlayPurchaseResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateIOSReceiptRequest + * @return Async Task will return ValidateIOSReceiptResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateIOSReceiptAsync(request); + } + }); + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateIOSReceiptRequest + * @return ValidateIOSReceiptResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateIOSReceipt(final ValidateIOSReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateIOSReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateIOSReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the purchased catalog item * @param request ValidateWindowsReceiptRequest diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientModels.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientModels.java index 27679d24..3649ead6 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientModels.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientModels.java @@ -1451,7 +1451,7 @@ public static class GetFriendLeaderboardAroundPlayerRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1503,7 +1503,7 @@ public static class GetFriendLeaderboardRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1579,7 +1579,7 @@ public static class GetLeaderboardAroundPlayerRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1643,7 +1643,7 @@ public static class GetLeaderboardRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1832,7 +1832,7 @@ public static class GetPlayerProfileRequest { */ public String PlayFabId; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -2334,7 +2334,7 @@ public static class GrantCharacterToUserRequest { */ public String ItemId; /** - * Non-unique display name of the character being granted. + * Non-unique display name of the character being granted (1-20 characters in length). */ public String CharacterName; @@ -3341,11 +3341,11 @@ public static class PlayerProfileModel { */ public String PublisherId; /** - * Title ID this profile applies to + * Title ID this player profile applies to */ public String TitleId; /** - * PlayFab Player ID + * PlayFab player account unique identifier */ public String PlayerId; /** @@ -3357,7 +3357,7 @@ public static class PlayerProfileModel { */ public LoginIdentityProvider Origination; /** - * Last login + * UTC time when the player most recently logged in to the title */ public Date LastLogin; /** @@ -3365,15 +3365,15 @@ public static class PlayerProfileModel { */ public Date BannedUntil; /** - * List of geographic locations where the player has logged-in + * List of geographic locations from which the player has logged in to the title */ public ArrayList Locations; /** - * Player Display Name + * Player display name */ public String DisplayName; /** - * Image URL of the player's avatar + * URL of the player's avatar image */ public String AvatarUrl; /** @@ -3385,7 +3385,7 @@ public static class PlayerProfileModel { */ public ArrayList PushNotificationRegistrations; /** - * List of third party accounts linked to this player + * List of all authentication systems linked to this player account */ public ArrayList LinkedAccounts; /** @@ -3393,15 +3393,15 @@ public static class PlayerProfileModel { */ public ArrayList AdCampaignAttributions; /** - * A sum of player's total purchases across all real-money currencies, converted to US Dollars equivalent + * Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. */ public Long TotalValueToDateInUSD; /** - * List of player's total lifetime real-money purchases by currency + * List of the player's lifetime purchase totals, summed by real-money currency */ public ArrayList ValuesToDate; /** - * List of player's virtual currency balances + * List of the player's virtual currency balances */ public ArrayList VirtualCurrencyBalances; /** @@ -3644,7 +3644,7 @@ public static class RegisterPlayFabUserRequest { */ public Boolean RequireBothUsernameAndEmail; /** - * An optional parameter for setting the display name for this title. + * An optional parameter for setting the display name for this title (3-25 characters). */ public String DisplayName; /** @@ -4906,11 +4906,11 @@ public static class ValueToDateModel { */ public String Currency; /** - * Total value of the purchases in a whole number of 1/100 monetary units. For example 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') */ public Long TotalValue; /** - * Total value of the purchases in a string representation of decimal monetary units (e.g. '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD')) + * Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD'. */ public String TotalValueAsDecimal; diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java index 2551e4da..490308a4 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -3,9 +3,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.50.170530"; - public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.50.170530"; + public static String SdkVersion = "0.51.170612"; + public static String BuildIdentifier = "jbuild_javasdk_1"; + public static String SdkVersionString = "JavaSDK-0.51.170612"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler; diff --git a/PlayFabSDK/pom.xml b/PlayFabSDK/pom.xml index 3af791dd..b02a54d8 100644 --- a/PlayFabSDK/pom.xml +++ b/PlayFabSDK/pom.xml @@ -4,7 +4,7 @@ 2016 com.playfab combo-sdk - 0.50.170530 + 0.51.170612 PlayFab Combo API PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. http://api.playfab.com/ diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabClientAPI.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabClientAPI.java index 91c5f864..7fb49b9b 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabClientAPI.java @@ -5574,192 +5574,6 @@ private static PlayFabResult privateSetFriendTagsAsync(fina return pfResult; } - /** - * Registers the iOS device to receive push notifications - * @param request RegisterForIOSPushNotificationRequest - * @return Async Task will return RegisterForIOSPushNotificationResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> RegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRegisterForIOSPushNotificationAsync(request); - } - }); - } - - /** - * Registers the iOS device to receive push notifications - * @param request RegisterForIOSPushNotificationRequest - * @return RegisterForIOSPushNotificationResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult RegisterForIOSPushNotification(final RegisterForIOSPushNotificationRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRegisterForIOSPushNotificationAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Registers the iOS device to receive push notifications - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - RegisterForIOSPushNotificationResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Restores all in-app purchases based on the given restore receipt - * @param request RestoreIOSPurchasesRequest - * @return Async Task will return RestoreIOSPurchasesResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> RestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRestoreIOSPurchasesAsync(request); - } - }); - } - - /** - * Restores all in-app purchases based on the given restore receipt - * @param request RestoreIOSPurchasesRequest - * @return RestoreIOSPurchasesResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult RestoreIOSPurchases(final RestoreIOSPurchasesRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateRestoreIOSPurchasesAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Restores all in-app purchases based on the given restore receipt - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - RestoreIOSPurchasesResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateIOSReceiptRequest - * @return Async Task will return ValidateIOSReceiptResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> ValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateIOSReceiptAsync(request); - } - }); - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateIOSReceiptRequest - * @return ValidateIOSReceiptResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult ValidateIOSReceipt(final ValidateIOSReceiptRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateIOSReceiptAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateIOSReceiptResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - /** * Get details about all current running game servers matching the given parameters. * @param request CurrentGamesRequest @@ -6009,29 +5823,29 @@ private static PlayFabResult privateStartGameAsync(final StartG } /** - * Registers the Android device to receive push notifications - * @param request AndroidDevicePushNotificationRegistrationRequest - * @return Async Task will return AndroidDevicePushNotificationRegistrationResult + * Writes a character-based event into PlayStream. + * @param request WriteClientCharacterEventRequest + * @return Async Task will return WriteEventResponse */ @SuppressWarnings("unchecked") - public static FutureTask> AndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAndroidDevicePushNotificationRegistrationAsync(request); + public static FutureTask> WriteCharacterEventAsync(final WriteClientCharacterEventRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWriteCharacterEventAsync(request); } }); } /** - * Registers the Android device to receive push notifications - * @param request AndroidDevicePushNotificationRegistrationRequest - * @return AndroidDevicePushNotificationRegistrationResult + * Writes a character-based event into PlayStream. + * @param request WriteClientCharacterEventRequest + * @return WriteEventResponse */ @SuppressWarnings("unchecked") - public static PlayFabResult AndroidDevicePushNotificationRegistration(final AndroidDevicePushNotificationRegistrationRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAndroidDevicePushNotificationRegistrationAsync(request); + public static PlayFabResult WriteCharacterEvent(final WriteClientCharacterEventRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWriteCharacterEventAsync(request); } }); try { @@ -6043,181 +5857,57 @@ public PlayFabResult call() thr } /** - * Registers the Android device to receive push notifications + * Writes a character-based event into PlayStream. */ @SuppressWarnings("unchecked") - private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { + private static PlayFabResult privateWriteCharacterEventAsync(final WriteClientCharacterEventRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/WriteCharacterEvent", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { PlayFabError error = (PlayFabError)httpResult; if (PlayFabSettings.GlobalErrorHandler != null) PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); + PlayFabResult result = new PlayFabResult(); result.Error = error; return result; } String resultRawJson = (String) httpResult; - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - AndroidDevicePushNotificationRegistrationResult result = resultData.data; + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + WriteEventResponse result = resultData.data; - PlayFabResult pfResult = new PlayFabResult(); + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } /** - * Validates a Google Play purchase and gives the corresponding item to the player. - * @param request ValidateGooglePlayPurchaseRequest - * @return Async Task will return ValidateGooglePlayPurchaseResult + * Writes a player-based event into PlayStream. + * @param request WriteClientPlayerEventRequest + * @return Async Task will return WriteEventResponse */ @SuppressWarnings("unchecked") - public static FutureTask> ValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateGooglePlayPurchaseAsync(request); + public static FutureTask> WritePlayerEventAsync(final WriteClientPlayerEventRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWritePlayerEventAsync(request); } }); } /** - * Validates a Google Play purchase and gives the corresponding item to the player. - * @param request ValidateGooglePlayPurchaseRequest - * @return ValidateGooglePlayPurchaseResult + * Writes a player-based event into PlayStream. + * @param request WriteClientPlayerEventRequest + * @return WriteEventResponse */ @SuppressWarnings("unchecked") - public static PlayFabResult ValidateGooglePlayPurchase(final ValidateGooglePlayPurchaseRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateGooglePlayPurchaseAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates a Google Play purchase and gives the corresponding item to the player. - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateGooglePlayPurchaseResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Writes a character-based event into PlayStream. - * @param request WriteClientCharacterEventRequest - * @return Async Task will return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static FutureTask> WriteCharacterEventAsync(final WriteClientCharacterEventRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWriteCharacterEventAsync(request); - } - }); - } - - /** - * Writes a character-based event into PlayStream. - * @param request WriteClientCharacterEventRequest - * @return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static PlayFabResult WriteCharacterEvent(final WriteClientCharacterEventRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWriteCharacterEventAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Writes a character-based event into PlayStream. - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateWriteCharacterEventAsync(final WriteClientCharacterEventRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/WriteCharacterEvent", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - WriteEventResponse result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - - /** - * Writes a player-based event into PlayStream. - * @param request WriteClientPlayerEventRequest - * @return Async Task will return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static FutureTask> WritePlayerEventAsync(final WriteClientPlayerEventRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWritePlayerEventAsync(request); - } - }); - } - - /** - * Writes a player-based event into PlayStream. - * @param request WriteClientPlayerEventRequest - * @return WriteEventResponse - */ - @SuppressWarnings("unchecked") - public static PlayFabResult WritePlayerEvent(final WriteClientPlayerEventRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateWritePlayerEventAsync(request); + public static PlayFabResult WritePlayerEvent(final WriteClientPlayerEventRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateWritePlayerEventAsync(request); } }); try { @@ -7372,68 +7062,6 @@ private static PlayFabResult privateUpdateCharacterDa return pfResult; } - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateAmazonReceiptRequest - * @return Async Task will return ValidateAmazonReceiptResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateAmazonIAPReceiptAsync(request); - } - }); - } - - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - * @param request ValidateAmazonReceiptRequest - * @return ValidateAmazonReceiptResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateValidateAmazonIAPReceiptAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { - if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - ValidateAmazonReceiptResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - /** * Accepts an open trade (one that has not yet been accepted or cancelled), if the locally signed-in player is in the allowed player list for the trade, or it is open to all players. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. * @param request AcceptTradeRequest @@ -7932,6 +7560,378 @@ private static PlayFabResult privateGetPlayerTagsAsync(fina return pfResult; } + /** + * Registers the Android device to receive push notifications + * @param request AndroidDevicePushNotificationRegistrationRequest + * @return Async Task will return AndroidDevicePushNotificationRegistrationResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> AndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAndroidDevicePushNotificationRegistrationAsync(request); + } + }); + } + + /** + * Registers the Android device to receive push notifications + * @param request AndroidDevicePushNotificationRegistrationRequest + * @return AndroidDevicePushNotificationRegistrationResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AndroidDevicePushNotificationRegistration(final AndroidDevicePushNotificationRegistrationRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAndroidDevicePushNotificationRegistrationAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Registers the Android device to receive push notifications + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + AndroidDevicePushNotificationRegistrationResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Registers the iOS device to receive push notifications + * @param request RegisterForIOSPushNotificationRequest + * @return Async Task will return RegisterForIOSPushNotificationResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> RegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRegisterForIOSPushNotificationAsync(request); + } + }); + } + + /** + * Registers the iOS device to receive push notifications + * @param request RegisterForIOSPushNotificationRequest + * @return RegisterForIOSPushNotificationResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RegisterForIOSPushNotification(final RegisterForIOSPushNotificationRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRegisterForIOSPushNotificationAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Registers the iOS device to receive push notifications + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + RegisterForIOSPushNotificationResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Restores all in-app purchases based on the given restore receipt + * @param request RestoreIOSPurchasesRequest + * @return Async Task will return RestoreIOSPurchasesResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> RestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRestoreIOSPurchasesAsync(request); + } + }); + } + + /** + * Restores all in-app purchases based on the given restore receipt + * @param request RestoreIOSPurchasesRequest + * @return RestoreIOSPurchasesResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RestoreIOSPurchases(final RestoreIOSPurchasesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRestoreIOSPurchasesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Restores all in-app purchases based on the given restore receipt + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + RestoreIOSPurchasesResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateAmazonReceiptRequest + * @return Async Task will return ValidateAmazonReceiptResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateAmazonReceiptRequest + * @return ValidateAmazonReceiptResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateAmazonReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + * @param request ValidateGooglePlayPurchaseRequest + * @return Async Task will return ValidateGooglePlayPurchaseResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateGooglePlayPurchaseAsync(request); + } + }); + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + * @param request ValidateGooglePlayPurchaseRequest + * @return ValidateGooglePlayPurchaseResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateGooglePlayPurchase(final ValidateGooglePlayPurchaseRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateGooglePlayPurchaseAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates a Google Play purchase and gives the corresponding item to the player. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateGooglePlayPurchaseResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateIOSReceiptRequest + * @return Async Task will return ValidateIOSReceiptResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateIOSReceiptAsync(request); + } + }); + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + * @param request ValidateIOSReceiptRequest + * @return ValidateIOSReceiptResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateIOSReceipt(final ValidateIOSReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateIOSReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateIOSReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the purchased catalog item * @param request ValidateWindowsReceiptRequest diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabClientModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabClientModels.java index 27679d24..3649ead6 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabClientModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabClientModels.java @@ -1451,7 +1451,7 @@ public static class GetFriendLeaderboardAroundPlayerRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1503,7 +1503,7 @@ public static class GetFriendLeaderboardRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1579,7 +1579,7 @@ public static class GetLeaderboardAroundPlayerRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1643,7 +1643,7 @@ public static class GetLeaderboardRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1832,7 +1832,7 @@ public static class GetPlayerProfileRequest { */ public String PlayFabId; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -2334,7 +2334,7 @@ public static class GrantCharacterToUserRequest { */ public String ItemId; /** - * Non-unique display name of the character being granted. + * Non-unique display name of the character being granted (1-20 characters in length). */ public String CharacterName; @@ -3341,11 +3341,11 @@ public static class PlayerProfileModel { */ public String PublisherId; /** - * Title ID this profile applies to + * Title ID this player profile applies to */ public String TitleId; /** - * PlayFab Player ID + * PlayFab player account unique identifier */ public String PlayerId; /** @@ -3357,7 +3357,7 @@ public static class PlayerProfileModel { */ public LoginIdentityProvider Origination; /** - * Last login + * UTC time when the player most recently logged in to the title */ public Date LastLogin; /** @@ -3365,15 +3365,15 @@ public static class PlayerProfileModel { */ public Date BannedUntil; /** - * List of geographic locations where the player has logged-in + * List of geographic locations from which the player has logged in to the title */ public ArrayList Locations; /** - * Player Display Name + * Player display name */ public String DisplayName; /** - * Image URL of the player's avatar + * URL of the player's avatar image */ public String AvatarUrl; /** @@ -3385,7 +3385,7 @@ public static class PlayerProfileModel { */ public ArrayList PushNotificationRegistrations; /** - * List of third party accounts linked to this player + * List of all authentication systems linked to this player account */ public ArrayList LinkedAccounts; /** @@ -3393,15 +3393,15 @@ public static class PlayerProfileModel { */ public ArrayList AdCampaignAttributions; /** - * A sum of player's total purchases across all real-money currencies, converted to US Dollars equivalent + * Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. */ public Long TotalValueToDateInUSD; /** - * List of player's total lifetime real-money purchases by currency + * List of the player's lifetime purchase totals, summed by real-money currency */ public ArrayList ValuesToDate; /** - * List of player's virtual currency balances + * List of the player's virtual currency balances */ public ArrayList VirtualCurrencyBalances; /** @@ -3644,7 +3644,7 @@ public static class RegisterPlayFabUserRequest { */ public Boolean RequireBothUsernameAndEmail; /** - * An optional parameter for setting the display name for this title. + * An optional parameter for setting the display name for this title (3-25 characters). */ public String DisplayName; /** @@ -4906,11 +4906,11 @@ public static class ValueToDateModel { */ public String Currency; /** - * Total value of the purchases in a whole number of 1/100 monetary units. For example 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') */ public Long TotalValue; /** - * Total value of the purchases in a string representation of decimal monetary units (e.g. '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD')) + * Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD'. */ public String TotalValueAsDecimal; diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabServerAPI.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabServerAPI.java index facad195..44c6e6ea 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabServerAPI.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabServerAPI.java @@ -4666,68 +4666,6 @@ private static PlayFabResult privateSetGameServ return pfResult; } - /** - * Awards the specified users the specified Steam achievements - * @param request AwardSteamAchievementRequest - * @return Async Task will return AwardSteamAchievementResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> AwardSteamAchievementAsync(final AwardSteamAchievementRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAwardSteamAchievementAsync(request); - } - }); - } - - /** - * Awards the specified users the specified Steam achievements - * @param request AwardSteamAchievementRequest - * @return AwardSteamAchievementResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult AwardSteamAchievement(final AwardSteamAchievementRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAwardSteamAchievementAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Awards the specified users the specified Steam achievements - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateAwardSteamAchievementAsync(final AwardSteamAchievementRequest request) throws Exception { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/AwardSteamAchievement", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - AwardSteamAchievementResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - /** * Writes a character-based event into PlayStream. * @param request WriteServerCharacterEventRequest @@ -6711,4 +6649,66 @@ private static PlayFabResult privateRemovePlayerTagAsync( pfResult.Result = result; return pfResult; } + + /** + * Awards the specified users the specified Steam achievements + * @param request AwardSteamAchievementRequest + * @return Async Task will return AwardSteamAchievementResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> AwardSteamAchievementAsync(final AwardSteamAchievementRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAwardSteamAchievementAsync(request); + } + }); + } + + /** + * Awards the specified users the specified Steam achievements + * @param request AwardSteamAchievementRequest + * @return AwardSteamAchievementResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AwardSteamAchievement(final AwardSteamAchievementRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAwardSteamAchievementAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Awards the specified users the specified Steam achievements + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAwardSteamAchievementAsync(final AwardSteamAchievementRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/AwardSteamAchievement", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + AwardSteamAchievementResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } } diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java index f2b425e6..a3569caa 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java @@ -1455,7 +1455,7 @@ public static class GetFriendLeaderboardRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1531,7 +1531,7 @@ public static class GetLeaderboardAroundUserRequest { */ public Integer MaxResultsCount; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; /** @@ -1599,7 +1599,7 @@ public static class GetLeaderboardRequest { */ public Integer MaxResultsCount; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; /** @@ -1780,7 +1780,7 @@ public static class GetPlayerProfileRequest { */ public String PlayFabId; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -2169,7 +2169,7 @@ public static class GrantCharacterToUserRequest { */ public String PlayFabId; /** - * Non-unique display name of the character being granted. + * Non-unique display name of the character being granted (1-20 characters in length). */ public String CharacterName; /** @@ -2856,11 +2856,11 @@ public static class PlayerProfileModel { */ public String PublisherId; /** - * Title ID this profile applies to + * Title ID this player profile applies to */ public String TitleId; /** - * PlayFab Player ID + * PlayFab player account unique identifier */ public String PlayerId; /** @@ -2872,7 +2872,7 @@ public static class PlayerProfileModel { */ public LoginIdentityProvider Origination; /** - * Last login + * UTC time when the player most recently logged in to the title */ public Date LastLogin; /** @@ -2880,15 +2880,15 @@ public static class PlayerProfileModel { */ public Date BannedUntil; /** - * List of geographic locations where the player has logged-in + * List of geographic locations from which the player has logged in to the title */ public ArrayList Locations; /** - * Player Display Name + * Player display name */ public String DisplayName; /** - * Image URL of the player's avatar + * URL of the player's avatar image */ public String AvatarUrl; /** @@ -2900,7 +2900,7 @@ public static class PlayerProfileModel { */ public ArrayList PushNotificationRegistrations; /** - * List of third party accounts linked to this player + * List of all authentication systems linked to this player account */ public ArrayList LinkedAccounts; /** @@ -2908,15 +2908,15 @@ public static class PlayerProfileModel { */ public ArrayList AdCampaignAttributions; /** - * A sum of player's total purchases across all real-money currencies, converted to US Dollars equivalent + * Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. */ public Long TotalValueToDateInUSD; /** - * List of player's total lifetime real-money purchases by currency + * List of the player's lifetime purchase totals, summed by real-money currency */ public ArrayList ValuesToDate; /** - * List of player's virtual currency balances + * List of the player's virtual currency balances */ public ArrayList VirtualCurrencyBalances; /** @@ -4222,11 +4222,11 @@ public static class ValueToDateModel { */ public String Currency; /** - * Total value of the purchases in a whole number of 1/100 monetary units. For example 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') */ public Long TotalValue; /** - * Total value of the purchases in a string representation of decimal monetary units (e.g. '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD')) + * Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD'. */ public String TotalValueAsDecimal; diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java index 12edf86a..bb9cf0c3 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -3,9 +3,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.50.170530"; - public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.50.170530"; + public static String SdkVersion = "0.51.170612"; + public static String BuildIdentifier = "jbuild_javasdk_1"; + public static String SdkVersionString = "JavaSDK-0.51.170612"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler; diff --git a/PlayFabServerSDK/pom.xml b/PlayFabServerSDK/pom.xml index 557c2a0e..56f51539 100644 --- a/PlayFabServerSDK/pom.xml +++ b/PlayFabServerSDK/pom.xml @@ -4,7 +4,7 @@ 2016 com.playfab server-sdk - 0.50.170530 + 0.51.170612 PlayFab Server API PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. http://api.playfab.com/ diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerAPI.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerAPI.java index facad195..44c6e6ea 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerAPI.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerAPI.java @@ -4666,68 +4666,6 @@ private static PlayFabResult privateSetGameServ return pfResult; } - /** - * Awards the specified users the specified Steam achievements - * @param request AwardSteamAchievementRequest - * @return Async Task will return AwardSteamAchievementResult - */ - @SuppressWarnings("unchecked") - public static FutureTask> AwardSteamAchievementAsync(final AwardSteamAchievementRequest request) { - return new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAwardSteamAchievementAsync(request); - } - }); - } - - /** - * Awards the specified users the specified Steam achievements - * @param request AwardSteamAchievementRequest - * @return AwardSteamAchievementResult - */ - @SuppressWarnings("unchecked") - public static PlayFabResult AwardSteamAchievement(final AwardSteamAchievementRequest request) { - FutureTask> task = new FutureTask(new Callable>() { - public PlayFabResult call() throws Exception { - return privateAwardSteamAchievementAsync(request); - } - }); - try { - task.run(); - return task.get(); - } catch(Exception e) { - return null; - } - } - - /** - * Awards the specified users the specified Steam achievements - */ - @SuppressWarnings("unchecked") - private static PlayFabResult privateAwardSteamAchievementAsync(final AwardSteamAchievementRequest request) throws Exception { - if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); - - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/AwardSteamAchievement", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); - task.run(); - Object httpResult = task.get(); - if(httpResult instanceof PlayFabError) { - PlayFabError error = (PlayFabError)httpResult; - if (PlayFabSettings.GlobalErrorHandler != null) - PlayFabSettings.GlobalErrorHandler.callback(error); - PlayFabResult result = new PlayFabResult(); - result.Error = error; - return result; - } - String resultRawJson = (String) httpResult; - - PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); - AwardSteamAchievementResult result = resultData.data; - - PlayFabResult pfResult = new PlayFabResult(); - pfResult.Result = result; - return pfResult; - } - /** * Writes a character-based event into PlayStream. * @param request WriteServerCharacterEventRequest @@ -6711,4 +6649,66 @@ private static PlayFabResult privateRemovePlayerTagAsync( pfResult.Result = result; return pfResult; } + + /** + * Awards the specified users the specified Steam achievements + * @param request AwardSteamAchievementRequest + * @return Async Task will return AwardSteamAchievementResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> AwardSteamAchievementAsync(final AwardSteamAchievementRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAwardSteamAchievementAsync(request); + } + }); + } + + /** + * Awards the specified users the specified Steam achievements + * @param request AwardSteamAchievementRequest + * @return AwardSteamAchievementResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AwardSteamAchievement(final AwardSteamAchievementRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAwardSteamAchievementAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Awards the specified users the specified Steam achievements + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAwardSteamAchievementAsync(final AwardSteamAchievementRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/AwardSteamAchievement", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + AwardSteamAchievementResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } } diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java index f2b425e6..a3569caa 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java @@ -1455,7 +1455,7 @@ public static class GetFriendLeaderboardRequest { */ public Boolean UseSpecificVersion; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -1531,7 +1531,7 @@ public static class GetLeaderboardAroundUserRequest { */ public Integer MaxResultsCount; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; /** @@ -1599,7 +1599,7 @@ public static class GetLeaderboardRequest { */ public Integer MaxResultsCount; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; /** @@ -1780,7 +1780,7 @@ public static class GetPlayerProfileRequest { */ public String PlayFabId; /** - * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. On client, only ShowDisplayName, ShowStatistics, ShowAvatarUrl are allowed. + * If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time. */ public PlayerProfileViewConstraints ProfileConstraints; @@ -2169,7 +2169,7 @@ public static class GrantCharacterToUserRequest { */ public String PlayFabId; /** - * Non-unique display name of the character being granted. + * Non-unique display name of the character being granted (1-20 characters in length). */ public String CharacterName; /** @@ -2856,11 +2856,11 @@ public static class PlayerProfileModel { */ public String PublisherId; /** - * Title ID this profile applies to + * Title ID this player profile applies to */ public String TitleId; /** - * PlayFab Player ID + * PlayFab player account unique identifier */ public String PlayerId; /** @@ -2872,7 +2872,7 @@ public static class PlayerProfileModel { */ public LoginIdentityProvider Origination; /** - * Last login + * UTC time when the player most recently logged in to the title */ public Date LastLogin; /** @@ -2880,15 +2880,15 @@ public static class PlayerProfileModel { */ public Date BannedUntil; /** - * List of geographic locations where the player has logged-in + * List of geographic locations from which the player has logged in to the title */ public ArrayList Locations; /** - * Player Display Name + * Player display name */ public String DisplayName; /** - * Image URL of the player's avatar + * URL of the player's avatar image */ public String AvatarUrl; /** @@ -2900,7 +2900,7 @@ public static class PlayerProfileModel { */ public ArrayList PushNotificationRegistrations; /** - * List of third party accounts linked to this player + * List of all authentication systems linked to this player account */ public ArrayList LinkedAccounts; /** @@ -2908,15 +2908,15 @@ public static class PlayerProfileModel { */ public ArrayList AdCampaignAttributions; /** - * A sum of player's total purchases across all real-money currencies, converted to US Dollars equivalent + * Sum of the player's purchases made with real-money currencies, converted to US dollars equivalent and represented as a whole number of cents (1/100 USD). For example, 999 indicates nine dollars and ninety-nine cents. */ public Long TotalValueToDateInUSD; /** - * List of player's total lifetime real-money purchases by currency + * List of the player's lifetime purchase totals, summed by real-money currency */ public ArrayList ValuesToDate; /** - * List of player's virtual currency balances + * List of the player's virtual currency balances */ public ArrayList VirtualCurrencyBalances; /** @@ -4222,11 +4222,11 @@ public static class ValueToDateModel { */ public String Currency; /** - * Total value of the purchases in a whole number of 1/100 monetary units. For example 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') + * Total value of the purchases in a whole number of 1/100 monetary units. For example, 999 indicates nine dollars and ninety-nine cents when Currency is 'USD') */ public Long TotalValue; /** - * Total value of the purchases in a string representation of decimal monetary units (e.g. '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD')) + * Total value of the purchases in a string representation of decimal monetary units. For example, '9.99' indicates nine dollars and ninety-nine cents when Currency is 'USD'. */ public String TotalValueAsDecimal; diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java index 41ceefae..3fb87a32 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -3,9 +3,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.50.170530"; - public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.50.170530"; + public static String SdkVersion = "0.51.170612"; + public static String BuildIdentifier = "jbuild_javasdk_1"; + public static String SdkVersionString = "JavaSDK-0.51.170612"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler; diff --git a/builds/client-push-plugin-GPS10.0.1.jar b/builds/client-push-plugin-GPS10.0.1.jar deleted file mode 100644 index 8b5a5e75..00000000 Binary files a/builds/client-push-plugin-GPS10.0.1.jar and /dev/null differ diff --git a/builds/client-sdk-0.50.170530-javadoc.jar b/builds/client-sdk-0.50.170530-javadoc.jar deleted file mode 100644 index a25321cb..00000000 Binary files a/builds/client-sdk-0.50.170530-javadoc.jar and /dev/null differ diff --git a/builds/client-sdk-0.51.170612-javadoc.jar b/builds/client-sdk-0.51.170612-javadoc.jar new file mode 100644 index 00000000..d4fddd59 Binary files /dev/null and b/builds/client-sdk-0.51.170612-javadoc.jar differ diff --git a/builds/client-sdk-0.50.170530.jar b/builds/client-sdk-0.51.170612.jar similarity index 62% rename from builds/client-sdk-0.50.170530.jar rename to builds/client-sdk-0.51.170612.jar index 84b9737b..3530b2c8 100644 Binary files a/builds/client-sdk-0.50.170530.jar and b/builds/client-sdk-0.51.170612.jar differ diff --git a/builds/combo-sdk-0.50.170530-javadoc.jar b/builds/combo-sdk-0.50.170530-javadoc.jar deleted file mode 100644 index f517b0db..00000000 Binary files a/builds/combo-sdk-0.50.170530-javadoc.jar and /dev/null differ diff --git a/builds/combo-sdk-0.51.170612-javadoc.jar b/builds/combo-sdk-0.51.170612-javadoc.jar new file mode 100644 index 00000000..cc86ba35 Binary files /dev/null and b/builds/combo-sdk-0.51.170612-javadoc.jar differ diff --git a/builds/combo-sdk-0.50.170530.jar b/builds/combo-sdk-0.51.170612.jar similarity index 70% rename from builds/combo-sdk-0.50.170530.jar rename to builds/combo-sdk-0.51.170612.jar index a5d37e36..a3274c5e 100644 Binary files a/builds/combo-sdk-0.50.170530.jar and b/builds/combo-sdk-0.51.170612.jar differ diff --git a/builds/server-sdk-0.50.170530-javadoc.jar b/builds/server-sdk-0.50.170530-javadoc.jar deleted file mode 100644 index 43b52d47..00000000 Binary files a/builds/server-sdk-0.50.170530-javadoc.jar and /dev/null differ diff --git a/builds/server-sdk-0.51.170612-javadoc.jar b/builds/server-sdk-0.51.170612-javadoc.jar new file mode 100644 index 00000000..e670309b Binary files /dev/null and b/builds/server-sdk-0.51.170612-javadoc.jar differ diff --git a/builds/server-sdk-0.50.170530.jar b/builds/server-sdk-0.51.170612.jar similarity index 73% rename from builds/server-sdk-0.50.170530.jar rename to builds/server-sdk-0.51.170612.jar index 0aea8b91..eed3e4a0 100644 Binary files a/builds/server-sdk-0.50.170530.jar and b/builds/server-sdk-0.51.170612.jar differ