Skip to content

Commit

Permalink
v3.14.0: function support added
Browse files Browse the repository at this point in the history
- initial sequential sync
- sequential sync
  • Loading branch information
ishaileshmishra committed Feb 6, 2024
1 parent a5e841d commit 080cc05
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contentstack/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android.buildFeatures.buildConfig true
mavenPublishing {
publishToMavenCentral(SonatypeHost.DEFAULT)
signAllPublications()
coordinates("com.contentstack.sdk", "android", "3.14.0")
coordinates("com.contentstack.sdk", "android", "3.14.0-SNAPSHOT")

pom {
name = "contentstack-android"
Expand Down
29 changes: 24 additions & 5 deletions contentstack/src/main/java/com/contentstack/sdk/SyncStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,24 @@ public class SyncStack {
private int count;
private String URL;
private String pagination_token;
private String sync_token;
private String syncToken;
private ArrayList<JSONObject> syncItems;
private String sequentialToken;


/**
* Gets sequential token based on sync response
*
* @return sequentialToken
*/
public String getSequentialToken() {
return sequentialToken;
}

public void setSequentialToken(String sequentialToken) {
this.sequentialToken = sequentialToken;
}

/**
* Gets url.
*
Expand Down Expand Up @@ -82,7 +96,7 @@ public String getPaginationToken() {
* @return the sync token
*/
public String getSyncToken() {
return this.sync_token;
return this.syncToken;
}

/**
Expand Down Expand Up @@ -130,12 +144,17 @@ protected void setJSON(JSONObject jsonobject) {
if (receiveJson.has("pagination_token")) {
this.pagination_token = receiveJson.optString("pagination_token");
} else {
this.sync_token = null;
this.syncToken = null;
}
if (receiveJson.has("sync_token")) {
this.sync_token = receiveJson.optString("sync_token");
this.syncToken = receiveJson.optString("sync_token");
} else {
this.syncToken = null;
}
if (receiveJson.has("last_seq_id")) {
this.sequentialToken = receiveJson.optString("last_seq_id");
} else {
this.sync_token = null;
this.sequentialToken = null;
}
}
} catch (Exception e) {
Expand Down

0 comments on commit 080cc05

Please sign in to comment.