Customer Journey / Digital Journey / Onboarding Customers – GBG IDscan Documentation

Customer Journey / Digital Journey / Onboarding Customers

It’s as easy as implementing a listener and calling another activity:

The journey will be done as defined by IEOS Customer Journey configuration.

Implement or create an instance of CustomerJourneyEventListener implementation

Java

 private CustomerJourneyEventListener customerJourneyEventListener = new CustomerJourneyEventListener() {
 
    /**
    * Provides version information
    *
    */
    @Override
    public void onServerInfo(@NotNull ResponseVersionInfo info) {
 
    }
 
    /**
    * Called back if customer clicked back or exits Customer Journey.
    */
    @Override
    public void onJourneyCanceled(@NotNull CustomerJourneyError customerJourneyError) {
 
    }
 
    /**
    * Callback for failure from which we dit not succeed to restore our self.
    */
    @Override
    public void onJourneyFailed(@NotNull CustomerJourneyError customerJourneyError) {
 
    }
 
    /**
    * Callback if journey was successfully completed.
    */
    @Override
    public void onJourneyCompleted(@NotNull ResponseJourney responseJourney) {
 
    }
}; 

Kotlin

    private val customerJourneyEventListener = object : CustomerJourneyEventListener {
 
    /**
    * Callback if journey was successfully completed.
    */
    override fun onJourneyCompleted(responseJourney: ResponseJourney) {
 
    }
 
    /**
    * Callback for failure from which we dit not succeed to restore our   self.
    */
    override fun onJourneyFailed(customerJourneyError: CustomerJourneyError) {
    }
 
    /**
    * Called back if customer clicked back or exits Customer Journey.
    */
    override fun onJourneyCanceled(customerJourneyError: CustomerJourneyError) {
    }
 
    /**
    * Provides version information
    *
    */
    override fun onServerInfo(info: ResponseVersionInfo) {
    }
} 

Register your implementation using

Please note: Kotlin registers before and unregisters after response as register would create a new instance and not override old.

To register the listener:

//Start the service in onStart and attach the listener   
    @Override
    protected void onStart() {
        super.onStart();
        MjcsEventService.registerService(this, mjcsEventService -> {
            service = mjcsEventService;
            service.setCustomerJourneyEventListener(customerJourneyEventListener);
return null;
        });
    }
 
//Detach listener in onStop and stop the service
    @Override
    protected void onStop() {
        service.setCustomerJourneyEventListener(null);
        service.unregisterService(this);
        super.onStop();
} 

kotlin

//Start the service in onStart and attach the listener   
override fun onStart() {
    super.onStart()
    registerService(this) {
        service = it
        service.customerJourneyEventListener = customerJourneyEventListener
    }
  }
 
//Detach listener in onStop and stop the service
override fun onStop() {
     service.customerJourneyEventListener = null
     service.unregisterService(this)
     super.onStop()
} 

Create an intent wit Customer journey configuration:

Kotlin

val config = CustomerJourneyConfig.Builder(
        baseUrl = baseUrl, // Add server base URL if POC server provided by GBG IDscan its most likely https://company.idscan.cloud
        credentials = Credentials(username, password), // Add Scanning Area credentials or use parameter name token and add it.
        certificates = emptyList(), // Reffer to section: SSL pinning CustomerJourney
    ).build()
// Call to open Customer Journey
    val customerJourney = Intent(this, CustomerJourneyActivity::class.java)
    customerJourney.putExtra(CustomerJourneyActivity.EXTRA_CONFIG, config)
startActivity(customerJourney) 

Please note: For security reasons ensure that credentials provided from a mobile device are scanning are and don’t have other permissions as this could compromise the security of your IEOS instance.

The Old way:

// Create intent to start scanner activity
Intent customerJourney = new Intent(this, CustomerJourneyActivity.class);
customerJourney.putExtra(CustomerJourneyActivity.EXTRA_BASE_LINK, baseUrl); // Add server base URL if POC server provided by GBG IDscan its most likely https://company.idscan.cloud
customerJourney.putExtra(CustomerJourneyActivity.EXTRA_CREDENTIALS, // Add Scanning Area credentials
        new Credentials(username, password));
startActivity(customerJourney); 

Don’t forget to add a check for camera permissions.

Possible onJourneyFailed(CustomerJourneyError) codes.

CodeDescription
EnterpriseService.EXCEPTION_ERRORReturns when Web service experienced an unrecoverable situation and returns a localized exception message.
500Internal server error, more information on the server side.
408Server time out
401Unauthorized, possibly bad credentials.
400Bad Request
Other error HTTP status codes possible https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
CustomerJourneyErrorErrors from customer journey itself
NONENo error.
GENERALGeneral error check message
NO_SERVER_RESPONSEJourney Failed server didn’t respond.
UNKNOWN_REQUIRED_ACTIONJourney Failed because of unknown action
CAMERAJourney Failed because of camera failure
WEB_INITIALIZINGCreating a webservice instance failed
WEB_INITIALIZING_BAD_URLCreating Retrofit instance failed with IllegalArgumentException
EXECUTION
Execution error, most likely exceptions from which we are not recovering, will send exception localized message.

For more information check JavaDocs on possible call exceptions.

Was this page helpful?