remitosqc

Offline capabilities

0 votes
Hi! We are integrating the eSign SDK for iOs and our application is "offline first". Everything has to be smooth without an internet connexion. We have two issues right now in offline mode. 1- If we launch the app with an internet connection, then go on airplane mode and start a pdf transaction, we get an Error 500 for the server and cannot start the signing process. But if we kill the app, restart (in offline mode) everything is working great. We seem to have this problem only when the internet connection dropped just before the call to login in eSign SDK. Have you experiment such an issue and do you have a workaround for it? 2. We are trying to force sync pdf transactions made offline, but the call to 'startSyncing' doesn't send the signed PDF to the cloud at the time of call. It seems to be send it randomly in future time (for exemple when signing an other document while online). Thank you for your help! Remi Mongeau

Reply to: Offline capabilities

0 votes
Hi Remi, For the point 2, I am seeing the same behavior: when invoking [eSignLiveKit startSyncing];, the queue status was up and transactions in the queue was marked as "under synchronizing", while I didn't see the didSynchronizeTransaction callback get invoked. I've worked with support team to file a Jira ticket on this. I will keep you informed once I got any updates. For the point 1, could you clarify the steps to reproduce the problem? Because if you were seeing 500 error, it's returning from OneSpan Sign server, which means your device was still under internet when receiving this error, while you mentioned that the "start from pdf" was triggered offline. A screenshot of the error message that you were receiving could also help. Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Offline capabilities

0 votes
For point 1, the steps to reproduce the error is this : 1. Start a transaction from PDF while having internet connection 2. Close transaction 3. Lose connection (or go on Airplane mode) 4. Try to start another transaction from PDF without connection Starting a transaction implies that we call this method:
eSignLive.dashboard().login()
. But the dictionary callback gives us this error :
Error Domain=Server Error Code=500 "(null)"
Is it because we call login() each time we want to start another transaction ?

Reply to: Offline capabilities

0 votes
Hi Max, Thanks for the steps! Now I can reproduce the same error. And I believe you were referring to the function description:
/*!
 @brief Logs the user into the SDK with cloud credentials.
 @discussion For first time login, the connection to the server is required. Subsequent logins could be performed while offline.Login should always be performed before starting or prefetching a signing ceremony. Log out @see logoutWithCallback should always be called before performing login for a different user
@param email (NSString *) cannot be nil/@""
@param password (NSString *) cannot be nil/@""
@param callback a response object containing either valid session token or an error is returned
 */
Below are some points from my testing and understanding, towards the issue: (1) Essentially, each login() function internally called an API call: use login credentials to exchange for a temporary session token(default expiry in 30 mins), set as a cookie header. (2) You can call login() function multiple times when connecting to network, as the point 1 indicates. However, when you were offline: if you never logged in, you will see returned dictionary saying "sessionToken":"SESSION_TOKEN_NOT_FOUND"; if you've logged in once, the return is the 500 error as you saw. (3) There're some attributes, functions and callbacks related to the session expiry to help you make sure that the session keeps alive:
/**
 @discussion
 * Property that defines the SDK behavior in case of expiring the session.
 * If the property is set to YES, the SDK will perform the refreshing of the session token internally
 * If the property is set to NO, the SDK will notify the application, that a login must be performed.
 * Default value - YES
 */
@property (nonatomic) BOOL keepSessionAlive;

- (BOOL)hasValidSession;


/**
 @abstract
 *  Notifies when the eSignLive session has expired and 
 */
@required
- (void)sessionHasExpired;

(4) Further more, if you have tested, you actually were able to create a transaction offline without even logged in. (5) There's a function isConnectionReachable allowing you to detect whether you are on/offline. Given all the facts above, I would suggest below practices: (1) Call isConnectionReachable() function before trying to login() (2) If you rely on the keep-session-alive mechanism, you don't need to login multiple times. (3) For online functions (for example, startSyncing()) , you can choose to internally call login() to make sure your application has an unexpired sessionToken. Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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