Android
Latest Version: 1.2.0
Below are the various processes involved in setting up SpotChecks on Android.
Installation
Insert the following in your build.gradle file at the end of the repositories section.
Add the following line to your app modules, present in the build.gradle file within the dependencies section.
The SurveySparrowSdk requires Internet access to fetch surveys and submit answers. So, add the following permissions to the AndroidManifest.xml file.
Below are the necessary imports before initializing the Spotchecks.
Initialization
SpotCheckConfig needs to be declared in the composable function
Anonymous users
If you wish not to keep track of users' data, you can follow the below syntax for initialization.
Known Users
If you wish to keep track of users' data and perform conditional Survey triggers, you can follow the below syntax for initialization.
Then, add the SpotCheck Composabe Function to all the screens where you want to display the surveys.
Note: Add the spotCheckConfig variable outside of the scaffold.
Screen Track
It provides the ability to keep track of screens the users are visiting and to enable the survey trigger on that screen.
Syntax:
Example:
If a survey needs to be triggered on the payment page, the name of the ScreenName should be specified in the TrackScreen function.
Event Track
It provides the ability to keep track of events which when triggered, will enable the survey to be popped.
Syntax:
Example:
If a survey needs to be triggered when the user completes a payment, then the TrackEvent function should be called with the respective ScreenName and optional custom properties.
Make sure to have the eventName configured in the Checks section of the configure panel
Last updated