Skip to main content

The DeviceScan Object

To use DeviceScanSDK, you must instantiate the DeviceScan class. This instance receives currentContext and can be configured with token/session, environment, and an optional callback (notifier).

Important Reminder!

Starting from version 5.0.0, the authentication system was updated to use a temporary token instead of mobileToken.

Versão 5.0.0+

ParameterPurposeRequired
currentContextThe application context, used to access required data.Yes.
token (via .setToken(this.token))Temporary authentication token that identifies that the collected data comes from your application. The token is obtained by making a request to the Device Scan API.Yes.
sessionId (via .setSessionId(this.sessionId))Session identifier from which the collected data originates.Yes.
notifier (via .setNotifier(this.deviceScanNotifier))An instance of DeviceScanNotifier. Works as a callback, returning the delivery status (success or failure).No.
sandbox (via .setSandboxEnvironment())Configures the library to send data to the sandbox environment. If not set, requests are sent to production.No.

Default environment: if setSandboxEnvironment() is not called, requests are sent to production.

Earlier Versions (up to 4.x)

ParameterPurposeRequired
currentContextThe application context, used to access required data.Yes.
mobileToken (via .setMobileToken(this.mobileToken))Customer key that identifies that the collected data comes from your application. If you have not yet received your mobile-token, contact support at: suporte.caas@qitech.com.br.Yes.
sessionId (via .setSessionId(this.sessionId))Session identifier from which the collected data originates.Yes.
notifier (via .setNotifier(this.deviceScanNotifier))An instance of DeviceScanNotifier. Works as a callback, returning the delivery status (success or failure).No.
sandbox (via .setSandboxEnvironment())Configures the library to send data to the sandbox environment. If not set, requests are sent to `production.No.

Quick Summary (Migration)

  • 5.0.0+: use a temporary token (setToken(this.token))
  • < 5.0.0: use mobileToken (setMobileToken(this.mobileToken))
  • In both: currentContext and sessionId are required. notifier and sandbox are optional.