This topic contains 12 replies, has 2 voices, and was last updated by  Duo_Liang 2 weeks, 2 days ago.

  • Author
    Posts
  • Participant
    senthilnatarajan
    Member
    Member since: 24.07.2018
    Number of posts: 19

    Hi OneSpan Team – We have a requirement where when the ESign doc is loaded in IFRAME , we need to capture events (consent accept , E sign acceptance)
    via the window listener, we have included the attached JS for this purpose , but seems the events (default included) in the JS are called only for the first time
    when the doc is loaded , any other event is not captured even for the default , Can you please help us on this.
    Please find attached.

    Regards,
    Danny

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 766

    Score

    0

    Hi Danny,

    Your attachment has an Upload Error, you can compress it into zip file and upload again.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    senthilnatarajan
    Member
    Member since: 24.07.2018
    Number of posts: 19

    Score

    0

    Hi Duo – Have attached the same in zip

    Regards,
    Danny

    Attachments:
    You must be logged in to view attached files.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 766

    Score

    0

    Hi Danny,

    Please make sure that you’ve added below case clause into your switch statement:

    				case 'ESL:MESSAGE:REGISTER':
    					event.source.postMessage('ESL:MESSAGE:ACTIVATE_EVENTS', origin);
    					break;

    Which is used to register message listening with OneSpan Sign.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    senthilnatarajan
    Member
    Member since: 24.07.2018
    Number of posts: 19

    Score

    0

    Hi Duo – The case clause that you posted is already in the JS code that I had posted earlier , The JS code was downloaded from ESign site and sent as it is to you.
    have tried with the mentioned case clause and it is not workable. Let me know your thoughts , Do we need to register or configure some place else to get
    this working ?

    Regards,
    Danny

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 766

    Score

    0

    Hi Danny,

    Yes, I realized that what you attached was the sample code as in our code share. So it should work properly with the code without extra configurations.
    One thing to mention is that, these events are now supported to be monitored:
    DOCUMENT_ACCEPT
    DOCUMENT_CONFIRM

    PACKAGE_OPT_OUT
    PACKAGE_DECLINE

    SIGNER_COMPLETE

    DOCUMENT_NAVIGATION

    So besides document navigation, document events can only be triggered once per document, package and signer events can only be triggered once per signing, in case this was what you meant.
    If the issue remains, you could send screenshares of your browser console to developer@esignlive.com and potentially we can setup an online session in private.

    Hope this could help!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    senthilnatarajan
    Member
    Member since: 24.07.2018
    Number of posts: 19

    Score

    0

    Hi Duo – Thanks for your reply , yes i had tried with adding the additional mentioned events in the switch case block but not workable , Atleast I was expecting the
    below default case to be fired in case none of the events matched , but that too is not workable. , Will try those again and let you know.

    Tested by setting Log message before and after but still nothing in Logs
    default:
    <% oLog.infoForced(“************ Log message before ” );%>
    event.source.postMessage(data, origin)
    <% oLog.infoForced(“************ Log message after ” );%>
    break;

    Have followed the below links for testing with the events you posted

    https://www.esignlive.com/blog/esignlive-event-notifier
    https://docs.esignlive.com/content/c_integrator_s_guide/event_notifier/event_notifier.htm

    Regards,
    Danny

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 766

    Score

    0

    Hi Danny,

    By directly checking the console.log in browser console (F12 in browser and click console tab), what you’ve seen?

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Participant
    senthilnatarajan
    Member
    Member since: 24.07.2018
    Number of posts: 19

    Score

    0

    Hi Duo – Attached the Zip file , with the console logs that i see , mentioned below few lines from the Logs.

    !TABTHREAD3:229 Uncaught ReferenceError: receiveMessage is not defined
    at !TABTHREAD3:229
    i18next.js:654 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/.
    (anonymous) @ i18next.js:654
    jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 3.0.0
    jquery.min.js?v=6885992034:4 XHR finished loading: GET “https://sandbox.esignlive.com/javascript/bower_components/intl-tel-input/lib/libphonenumber/build/utils.js”

    Regards,
    Danny

    Attachments:
    You must be logged in to view attached files.
    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 766

    Score

    0

    Hi Danny,

    I saw there’s one line in the log says “Uncaught ReferenceError: receiveMessage is not defined” and the subsequent log doesn’t show any event message like “ESL:MESSAGE:REGISTER” or “ESL:MESSAGE:SUCCESS:DOCUMENT_NAVIGATION”, logs like the attachment are expected.

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    Attachments:
    You must be logged in to view attached files.
    Participant
    senthilnatarajan
    Member
    Member since: 24.07.2018
    Number of posts: 19

    Score

    0

    Hi Duo – Yes went through the same , In our application logs it records for all events when the document is loaded for the first time , There is no event logged after that.
    As per the console logs do you have any resolution on how this can be fxied . Do we need to do any configurations at the browser level or any additional add-on ?

    Regards,
    Danny

    Participant
    senthilnatarajan
    Member
    Member since: 24.07.2018
    Number of posts: 19

    Score

    0

    Hi Duo – I am not getting the error “Uncaught ReferenceError: receiveMessage is not defined” as i placed the the call at the bottom of the script
    window.addEventListener(‘message’, receiveMessage, false); but still i dont see any events getting called including the default.

    Regards,
    Danny

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 766

    Score

    0

    Hi Danny,

    As we discussed on online session, after two changes in code was made:
    (1)put the code within document.getElementById(“myIFrame”).onload(function(){…});
    (2)change the parameter to “true” in window.addEventListener(‘message’, receiveMessage, true);
    The notification get fired and code works properly now.

    Glad to help and always feel free to raise any other questions!

    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist

You must be logged in to reply to this topic.