akokala | Posts: 5

Offline Android Package Creation and Esign

0 votes

Hi,

 

I am looking for code examples using Mobile SDK how to start creation of package and complete the transaction in offline and sync when connected online.

 

Please let me know if any one have performed the similar use cases.


Duo_Liang | Posts: 3776

Reply to: Offline Android Package Creation and Esign

0 votes

Hi akokala,

 

Assuming the auto sync is turned on, the synchronization process will be transparent to user. This is by default turned on, or you can use this code:
ESignLive.getInstance().setAutoSync(true);

If you by any chance tried the Sample app included in the SDK, with emulator, if you

(1)sign in with network.

(2)turned off the wifi and mobile data.

(3)hit the fourth button "Create Transaction Locally", which creates a package with two documents, two signers, then automatically kicks off the in-person signing ceremony.

(4)finish the signing.

(5)turn on wifi, you'll see the synchronization logs printed in the console.

 

Also, below code could be used to view all the transactions in the queue, and to manually force syncing:


List<SyncTransactionItem> transactionsSyncItems = SyncQueueRunner.getTransactionsSyncItems();

for (SyncTransactionItem transactionsSyncItem : transactionsSyncItems)

{

 System.out.println("transactionsSyncItem.getTransactionId() = " + transactionsSyncItem.getTransactionId());               SyncQueueRunner.forceSync(transactionsSyncItem.getTransactionId());

}

 

Duo


akokala | Posts: 5

Reply to: Offline Android Package Creation and Esign

0 votes

Thanks Duo for your response. Some how i am not able to compile the sample project downloaded with the SDK. But here is my requirement from existing React Native app i should be able to use the api by react bridges. (Exposing the Methods as react method and take arguments and create documents and sign it). Is this achievable. If yes what documents i need to start looking into it.


akokala | Posts: 5

Reply to: Offline Android Package Creation and Esign

0 votes

I looked at the Sample code, does CreateLocalTransaction Method in HomeActivity.Java is sufficient to start with exposing that  method for react to accept the Props and documents and use the code inside that method?


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off