Enable Users to Opt Out Of IQL

This section describes how to enable users to opt-out of the IQL program if they want to. On each app start, there's a check-in to see if the user(s) have opted into the IQL program. If a user has opted in, then the application calls the setup method.

When a user opts out of the IQL program, this block of code is executed to ensure that Zendrive SDK stops tracking trips. This section 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. Enable Zendrive SDK Teardown

When a user opts out of the IQL program, this block of code is executed to ensure that Zendrive SDK stops tracking trips.

Zendrive.teardown {
            DDLogInfo("Zendrive SDK has been deactivated successfully")
        }

2.0. Stop Zendrive SDK Initialization

If a user has opted out of the IQL program, the following code snippet 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.

func leaveProgram() {
        self.tripDao.clear()
        self.loginRepository.leaveProgram()
        Zendrive.teardown {
            DDLogInfo("Zendrive SDK has been deactivated successfully")
        }
    }

3.0. Publisher Integration Testing Checklist

Follow the testing checklist given below for enabling users to opt out of IQL:

  • Opt Out: Ensure that a confirmation dialog is presented when the user tries to opts out of the program. Use this message to inform the user about the consequences of opting out.