diff --git a/contentstack/build.gradle b/contentstack/build.gradle index 8b2c3e67..d22083ec 100755 --- a/contentstack/build.gradle +++ b/contentstack/build.gradle @@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true mavenPublishing { publishToMavenCentral(SonatypeHost.DEFAULT) signAllPublications() - coordinates("com.contentstack.sdk", "android", "3.14.0-SNAPSHOT") + coordinates("com.contentstack.sdk", "android", "3.14.0") pom { name = "contentstack-android" diff --git a/contentstack/src/main/java/com/contentstack/sdk/Stack.java b/contentstack/src/main/java/com/contentstack/sdk/Stack.java index f083bf67..e57c5a5f 100755 --- a/contentstack/src/main/java/com/contentstack/sdk/Stack.java +++ b/contentstack/src/main/java/com/contentstack/sdk/Stack.java @@ -291,17 +291,17 @@ private String getImageUrl() { * This call returns comprehensive information of all the content types available in a particular stack in your account. *

Example :
*
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 JSONObject params = new JSONObject();
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 params.put("include_snippet_schema", true);
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 params.put("limit", 3);
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 stack.getContentTypes(params, new ContentTypesCallback() {
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 @Override  public void onCompletion(ContentTypesModel contentTypesModel, Error error) {
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 if (error == null){
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 // do your stuff.
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 }
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 }
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 });
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
+ * JSONObject params = new JSONObject(); + * params.put("include_snippet_schema", true); + * params.put("limit", 3); + * stack.getContentTypes(params, new ContentTypesCallback() { + * @Override public void onCompletion(ContentTypesModel contentTypesModel, Error error) { + * if (error == null){ + * // do your stuff. + * } + * } + * }); + * */ public void getContentTypes(JSONObject params, final ContentTypesCallback callback) { try { @@ -348,16 +348,15 @@ private void fetchContentTypes(String urlString, JSONObject urlQueries, ArrayMap * It returns all the published entries and assets of the specified stack in response. * The response also contains a sync token, which you need to store, * since this token is used to get subsequent delta updates later. - * - *

Example :
*
-     *
-     * @deprecated sync is deprecated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 stack.syncPaginationToken(pagination_token, new SyncResultCallBack()) {}
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
+ *

Example :
+ * Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment"); + * + * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. */ - @Deprecated public void sync(SyncResultCallBack syncCallBack) { + @Deprecated + public void sync(SyncResultCallBack syncCallBack) { try { this.syncParams = new JSONObject(); this.syncParams.put("init", true); @@ -384,7 +383,7 @@ private void fetchContentTypes(String urlString, JSONObject urlQueries, ArrayMap * stack.syncPaginationToken(pagination_token, new SyncResultCallBack()) {} * * - * @deprecated This method is deprecated. Use {@link #initSeqSync(SyncResultCallBack)} instead. + * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. */ @Deprecated public void syncPaginationToken(String paginationToken, SyncResultCallBack syncCallBack) { @@ -406,7 +405,7 @@ public void syncPaginationToken(String paginationToken, SyncResultCallBack syncC * and the details of the content that was deleted or updated. *

Example :
*
-     @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+ * @deprecated This method is deprecated. Use {@link #seqSync(String, SyncResultCallBack)} instead. */ @Deprecated public void syncToken(String syncToken, SyncResultCallBack syncCallBack) { @@ -428,6 +427,7 @@ public void syncToken(String syncToken, SyncResultCallBack syncCallBack) { public void initSeqSync(SyncResultCallBack syncCallBack) { try { this.syncParams = new JSONObject(); + this.syncParams.put("init", true); this.syncParams.put("seq_id", true); } catch (JSONException e) { Log.e(TAG, Objects.requireNonNull(e.getLocalizedMessage())); @@ -463,8 +463,8 @@ public void seqSync(String seqId, SyncResultCallBack syncCallBack) { * *

Example :
*
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                stack.syncFromDate(start_date, new SyncResultCallBack()) { }
-     *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
+ * stack.syncFromDate(start_date, new SyncResultCallBack()) { } + * */ public void syncFromDate(Date fromDate, SyncResultCallBack syncCallBack) { String startFromDate = convertUTCToISO(fromDate);