Record Events

Cordova ==> Core module

Pending Upload Queue

Records that have been collected but not yet uploaded are held in a persistent queue. You can inspect the queue without affecting the submission pipeline.

Get the number of records pending upload:

const count = await ValidicMobile.InformCore.getQueuedRecordCount();
console.log(`${count} records pending upload`);

Get the full list of records pending upload as an immutable snapshot:

const records = await ValidicMobile.InformCore.getQueuedInformRecords();
records.forEach(record => console.log(record));

Listening for Events

A document event is fired each time a record is submitted to the Validic API. A success event is emitted after a record has successfully uploaded to the server, and an error event is emitted if a record upload fails for any reason. Registration of listeners is typically done during app initialization to catch events for record uploads which may occur upon app launch.

document.addEventListener(ValidicMobile.InformCore.InformRecordSubmittedEvent, (event) => {
    console.log(event.payload.informRecord);
});

documentation.addEventListener(ValidicMobile.InformCore.InformRecordSubmitFailedEvent, (event) => {
    console.error(event.error);
});


Did this page help you?