From d6526a53ca98c2fcb1100e4bbe836700bfc4b495 Mon Sep 17 00:00:00 2001 From: LoginRadius Date: Fri, 20 Jan 2023 16:28:59 +0530 Subject: [PATCH] Released Version 11.5.0 --- CHANGELOG.md | 47 + LoginRadius-JavaSDK/pom.xml | 6 +- .../advanced/CustomRegistrationDataApi.java | 336 ----- .../PhoneAuthenticationApi.java | 7 +- .../sdk/api/social/NativeSocialApi.java | 36 - .../loginradius/sdk/api/social/SocialApi.java | 1104 ---------------- .../models/requestmodels/CaptchaModel.java | 64 + .../models/requestmodels/ReCaptchaModel.java | 50 +- .../RegistrationDataCreateModel.java | 109 -- .../RegistrationDataCreateModelList.java | 36 - .../RegistrationDataUpdateModel.java | 124 -- .../sdk/models/requestmodels/StatusModel.java | 124 -- .../responsemodels/PostMethodResponse.java | 49 - .../responsemodels/ShortUrlResponse.java | 64 - .../responsemodels/StatusUpdateResponse.java | 49 - .../responsemodels/otherobjects/Album.java | 199 --- .../responsemodels/otherobjects/Audio.java | 154 --- .../responsemodels/otherobjects/CheckIn.java | 229 ---- .../responsemodels/otherobjects/Contact.java | 199 --- .../otherobjects/CountryCodeName.java | 49 - .../otherobjects/CursorResponse.java | 51 - .../responsemodels/otherobjects/Events.java | 184 --- .../otherobjects/FacebookAlbumImages.java | 49 - .../responsemodels/otherobjects/Group.java | 169 --- .../responsemodels/otherobjects/Like.java | 109 -- .../responsemodels/otherobjects/Page.java | 426 ------ .../otherobjects/PageCategoryList.java | 49 - .../otherobjects/PageCodeName.java | 49 - .../otherobjects/PageCover.java | 79 -- .../otherobjects/PageLocations.java | 139 -- .../responsemodels/otherobjects/Photo.java | 246 ---- .../responsemodels/otherobjects/Post.java | 184 --- .../otherobjects/RegistrationDataField.java | 34 - .../RegistrationDataFieldBasic.java | 154 --- .../otherobjects/Speciality.java | 51 - .../responsemodels/otherobjects/Status.java | 154 --- .../otherobjects/StatusUpdateStats.java | 64 - .../responsemodels/otherobjects/Video.java | 199 --- .../userprofile/UserProfile.java | 16 + .../OrganizationResponseInProfile.java | 34 + README.md | 1139 +---------------- demo/pom.xml | 6 +- .../java/com/demo/LoginRadiusService.java | 4 +- .../src/main/resources/application.properties | 2 +- demo/src/main/resources/static/js/options.js | 2 +- 45 files changed, 213 insertions(+), 6415 deletions(-) delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/CustomRegistrationDataApi.java create mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/CaptchaModel.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RegistrationDataCreateModel.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RegistrationDataCreateModelList.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RegistrationDataUpdateModel.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/StatusModel.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/PostMethodResponse.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ShortUrlResponse.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/StatusUpdateResponse.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Album.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Audio.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/CheckIn.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Contact.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/CountryCodeName.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/CursorResponse.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Events.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/FacebookAlbumImages.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Group.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Like.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Page.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PageCategoryList.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PageCodeName.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PageCover.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PageLocations.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Photo.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Post.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RegistrationDataField.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RegistrationDataFieldBasic.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Speciality.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Status.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/StatusUpdateStats.java delete mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/Video.java create mode 100644 LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/OrganizationResponseInProfile.java diff --git a/CHANGELOG.md b/CHANGELOG.md index a59d1a0..3b39cf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,52 @@ > **LoginRadius Java SDK Change Log** provides information regarding what has changed, more specifically what changes, improvements and bug fix has been made to the SDK. For more details please refer to the [LoginRadius API Documention(https://www.loginradius.com/docs/api/v2/deployment/sdk-libraries/java-library/) +# Version 11.5.0 +Release on January 20, 2023 + +## Enhancements + +- We have updated some of the dependencies to the latest Version. + +## Removed (Deprecated) APIs: +- `AuthGetRegistrationData` +- `ValidateRegistrationDataCode` +- `GetRegistrationData` +- `AddRegistrationData` +- `UpdateRegistrationData` +- `DeleteRegistrationData` +- `DeleteAllRecordsByDataSource` +- `GetAccessTokenByVkontakteAccessToken` +- `GetAlbum` +- `GetAlbumsWithCursor` +- `GetAudios` +- `GetAudiosWithCursor` +- `GetCheckIns` +- `GetCheckInsWithCursor` +- `GetContacts` +- `GetEvents` +- `GetEventsWithCursor` +- `GetFollowings` +- `GetFollowingsWithCursor` +- `GetGroups` +- `GetGroupsWithCursor` +- `GetLikes` +- `GetLikesWithCursor` +- `GetMentions` +- `PostMessage` +- `GetPage` +- `GetPhotos` +- `GetPosts` +- `StatusPosting` +- `TrackableStatusPosting` +- `GetTrackableStatusStats` +- `TrackableStatusFetching` +- `GetVideos` +- `GetRefreshedSocialUserProfile` + +## Breaking Changes + +For developers migrating to v11.5.0, there will be minor breaking change in terms of SDK implementation. In this version, we have added `emailTemplate` parameter in `userRegistrationByPhone` Api. + # Version 11.4.0 Release on June 1, 2022 diff --git a/LoginRadius-JavaSDK/pom.xml b/LoginRadius-JavaSDK/pom.xml index 47441de..f4fa7c1 100644 --- a/LoginRadius-JavaSDK/pom.xml +++ b/LoginRadius-JavaSDK/pom.xml @@ -6,7 +6,7 @@ com.loginradius.sdk java-sdk - 11.4.0 + 11.5.0 LoginRadius-CustomerIdentity-JavaSDK LoginRadius Java SDK https://github.com/LoginRadius/java-sdk @@ -38,7 +38,7 @@ com.google.code.gson gson - 2.8.9 + 2.10 @@ -51,7 +51,7 @@ commons-codec commons-codec - 1.9 + 1.15 diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/CustomRegistrationDataApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/CustomRegistrationDataApi.java deleted file mode 100644 index 9d1a36e..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/CustomRegistrationDataApi.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2019 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.advanced; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.RegistrationDataCreateModelList; -import com.loginradius.sdk.models.requestmodels.RegistrationDataUpdateModel; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostValidationResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.RegistrationDataField; -import com.loginradius.sdk.models.responsemodels.otherobjects.UserProfilePostResponse; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class CustomRegistrationDataApi { - private static Gson gson =new Gson(); - - public CustomRegistrationDataApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to retrieve dropdown data. - // - // Type of the Datasource - // Retrieve number of records at a time(max limit is 50) - // Id of parent dropdown member(if any). - // Skip number of records from start - // Complete user Registration data - // 7.1 - - - public void authGetRegistrationData(String type, Integer limit, - String parentId, Integer skip, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(type)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("type")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (limit != null) { - queryParameters.put("limit", String.valueOf(limit)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(parentId)) { - queryParameters.put("parentId", parentId); - } - - if (skip != null) { - queryParameters.put("skip", String.valueOf(skip)); - } - - String resourcePath = "identity/v2/auth/registrationdata/" + type; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - RegistrationDataField[] successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API allows you to validate code for a particular dropdown member. - // - // Secret Code - // Selected dropdown item’s record id - // Response containing Definition of Complete Validation data - // 7.2 - - - public void validateRegistrationDataCode(String code, String recordId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(code)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("code")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(recordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("recordId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("code", code); - bodyParameters.addProperty("recordId", recordId); - - String resourcePath = "identity/v2/auth/registrationdata/validatecode"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostValidationResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve dropdown data. - // - // Type of the Datasource - // Retrive number of records at a time(max limit is 50 - // Id of parent dropdown member(if any). - // Skip number of records from start - // Complete user Registration data Fields - // 16.1 - - - public void getRegistrationData(String type, Integer limit, - String parentId, Integer skip, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(type)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("type")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (limit != null) { - queryParameters.put("limit", String.valueOf(limit)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(parentId)) { - queryParameters.put("parentId", parentId); - } - - if (skip != null) { - queryParameters.put("skip", String.valueOf(skip)); - } - - String resourcePath = "identity/v2/manage/registrationdata/" + type; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - RegistrationDataField[] successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API allows you to fill data into a dropdown list which you have created for user Registration. For more details on how to use this API please see our Custom Registration Data Overview - // - // Model Class containing Definition of List of Registration Data - // Response containing Definition of Complete Validation data - // 16.2 - - - public void addRegistrationData(RegistrationDataCreateModelList registrationDataCreateModelList, final AsyncHandler handler) { - - if (registrationDataCreateModelList == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("registrationDataCreateModelList")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/registrationdata"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(registrationDataCreateModelList), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API allows you to update a dropdown item - // - // Model Class containing Definition of payload for Registration Data update API - // Registration data RecordId - // Complete user Registration data Field - // 16.3 - - - public void updateRegistrationData(RegistrationDataUpdateModel registrationDataUpdateModel, String recordId, final AsyncHandler> handler) { - - if (registrationDataUpdateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("registrationDataUpdateModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(recordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("recordId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/registrationdata/" + recordId; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(registrationDataUpdateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API allows you to delete an item from a dropdown list. - // - // Registration data RecordId - // Response containing Definition of Delete Request - // 16.4 - - - public void deleteRegistrationData(String recordId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(recordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("recordId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/registrationdata/" + recordId; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API allows you to delete all records contained in a datasource. - // - // Type of the Datasource - // Response containing Definition of Delete Request - // 16.5 - - - public void deleteAllRecordsByDataSource(String type, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(type)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("type")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/registrationdata/type/" + type; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PhoneAuthenticationApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PhoneAuthenticationApi.java index 31339a5..7f37d78 100644 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PhoneAuthenticationApi.java +++ b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PhoneAuthenticationApi.java @@ -498,12 +498,13 @@ public void onFailure(ErrorResponse errorResponse) { // SMS Template name // Email verification url // Name of the welcome email template + // Name of the email template // Response containing Definition of Complete Validation, UserProfile data and Access Token // 17.1.2 public void userRegistrationByPhone(AuthUserRegistrationModel authUserRegistrationModel, String sott, - String fields, String options, String smsTemplate, String verificationUrl, String welcomeEmailTemplate, final AsyncHandler>> handler) { + String fields, String options, String smsTemplate, String verificationUrl, String welcomeEmailTemplate, String emailTemplate, final AsyncHandler>> handler) { if (authUserRegistrationModel == null) { throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("authUserRegistrationModel")); @@ -537,6 +538,10 @@ public void userRegistrationByPhone(AuthUserRegistrationModel authUserRegistrati queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); } + if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { + queryParameters.put("emailTemplate", emailTemplate); + } + String resourcePath = "identity/v2/auth/register"; LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(authUserRegistrationModel), new AsyncHandler() { diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/NativeSocialApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/NativeSocialApi.java index 1a2b3c4..28c5bde 100644 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/NativeSocialApi.java +++ b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/NativeSocialApi.java @@ -362,42 +362,6 @@ public void onFailure(ErrorResponse errorResponse) { }); } - // - // The API is used to get LoginRadius access token by sending Vkontakte's access token. It will be valid for the specific duration of time specified in the response. - // - // Vkontakte Access Token - // Response containing Definition of Complete Token data - // 20.15 - - - public void getAccessTokenByVkontakteAccessToken(String vkAccessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(vkAccessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("vkAccessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("vk_access_token", vkAccessToken); - - String resourcePath = "api/v2/access_token/vkontakte"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - // // The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response. // diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/SocialApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/SocialApi.java index 921fa72..03bda6e 100644 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/SocialApi.java +++ b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/SocialApi.java @@ -14,28 +14,9 @@ import com.loginradius.sdk.helper.JsonDeserializer; import com.loginradius.sdk.helper.LoginRadiusRequest; import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.StatusModel; import com.loginradius.sdk.models.responsemodels.AccessTokenBase; -import com.loginradius.sdk.models.responsemodels.PostMethodResponse; import com.loginradius.sdk.models.responsemodels.PostMethodResponseBase; -import com.loginradius.sdk.models.responsemodels.ShortUrlResponse; -import com.loginradius.sdk.models.responsemodels.StatusUpdateResponse; import com.loginradius.sdk.models.responsemodels.UserActiveSession; -import com.loginradius.sdk.models.responsemodels.otherobjects.Album; -import com.loginradius.sdk.models.responsemodels.otherobjects.Audio; -import com.loginradius.sdk.models.responsemodels.otherobjects.CheckIn; -import com.loginradius.sdk.models.responsemodels.otherobjects.Contact; -import com.loginradius.sdk.models.responsemodels.otherobjects.CursorResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.Events; -import com.loginradius.sdk.models.responsemodels.otherobjects.Group; -import com.loginradius.sdk.models.responsemodels.otherobjects.Like; -import com.loginradius.sdk.models.responsemodels.otherobjects.Page; -import com.loginradius.sdk.models.responsemodels.otherobjects.Photo; -import com.loginradius.sdk.models.responsemodels.otherobjects.Post; -import com.loginradius.sdk.models.responsemodels.otherobjects.Status; -import com.loginradius.sdk.models.responsemodels.otherobjects.StatusUpdateStats; -import com.loginradius.sdk.models.responsemodels.otherobjects.Video; -import com.loginradius.sdk.models.responsemodels.userprofile.UserProfile; import com.loginradius.sdk.util.AsyncHandler; import com.loginradius.sdk.util.ErrorResponse; import com.loginradius.sdk.util.LoginRadiusSDK; @@ -319,1089 +300,4 @@ public void onFailure(ErrorResponse errorResponse) { } }); } - - // - // Supported Providers: Facebook, Google, Live, Vkontakte.

This API returns the photo albums associated with the passed in access tokens Social Profile. - //
- // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response Containing List of Album Data - // 22.2.1 - - - public void getAlbums(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - - String resourcePath = "api/v2/album"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Album[] successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // Supported Providers: Facebook, Google, Live, Vkontakte.

This API returns the photo albums associated with the passed in access tokens Social Profile. - //
- // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Cursor value if not all contacts can be retrieved once. - // Response Model containing Albums with next cursor - // 22.2.2 - - - public void getAlbumsWithCursor(String accessToken, String nextCursor, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(nextCursor)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("nextCursor")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("nextCursor", nextCursor); - - String resourcePath = "api/v2/album"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - CursorResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The Audio API is used to get audio files data from the user's social account.

Supported Providers: Live, Vkontakte - //
- // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response Containing List of Audio Data - // 24.2.1 - - - public void getAudios(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - - String resourcePath = "api/v2/audio"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Audio[] successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The Audio API is used to get audio files data from the user's social account.

Supported Providers: Live, Vkontakte - //
- // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Cursor value if not all contacts can be retrieved once. - // Response Model containing Audio with next cursor - // 24.2.2 - - - public void getAudiosWithCursor(String accessToken, String nextCursor, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(nextCursor)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("nextCursor")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("nextCursor", nextCursor); - - String resourcePath = "api/v2/audio"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - CursorResponse