Enable Users to Opt Out Of IQL
On each app start, there's a check-in to see if the user(s) have opted into the IQL program. This section describes how to enable your users to opt out of IQL, and includes the following topics:
Enable Users to Opt Out Of IQL
Enable Users to Opt Out Of IQL
Enable Users to Opt Out Of IQL
1.0. Ensure That Zendrive SDK Stops Tracking Trips
If a user has opted out, then the application calls the teardown
method to ensure that Zendrive SDK stops tracking trips.
Zendrive.teardown(context()) {
Timber.d("Zendrive teardown result - ${it.isSuccess} ${it.errorMessage} ${it.errorCode}")
}
2.0. Stop Zendrive SDK from Initializing
If a user has opted out of the IQL program, the following block of code gets executed, which stops Zendrive SDK from initializing. This code clears all the saved user data from the IQL program and brings the application back to its initial state.
this.leave.setOnClickListener {
dialog?.dismiss()
ZWLCore.tearDownZenDriveSDK()
viewModel.setUserLeftTheProgram(true)
viewModel.clearPreference()
viewModel.clearProgramData()
viewModel.resetApiCallTimer()
viewModel.resetMockTestDrive()
val intent = Intent(requireContext(), OnboardingActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK
startActivity(intent)
requireActivity().finish()
}
3.0. Publisher Integration Testing Checklist
Use the following testing checklist to enable users to opt out of the IQL program:
Ensure that a confirmation dialog is presented when the user tries to opts out of the program, inform the user about the consequences of opting out.