React Native SDK
Pre Requisites
Zonka Feedback Mobile SDK requires an active Zonka Feedback account. In order to successfully run and test out the survey you would need to have an SDK token for the survey you want to implement. If you are already a user and have access to your SDK token you can directly jump to the Installation section. If not, read on and follow the following steps:
Create a new account on Zonka Feedback
Create a new survey with a choice of questions you would like to implement
Once your survey is created go to Distribute menu and click on the In-App tab
Enable the toggle to view the SDK token
Follow the below-mentioned steps to implement it in your app
Minimum Requirements
The react-native version should be 0.60 or more.
Installation
For installation, run the following
Minimum version of react-native-community/netinfo should be 6.0.2.
Minimum version of react-native-device-info should be 9.0.2.
Initialization
Create an SDK token for the required survey from Distribute menu and use that to initialize the SDK.
For specifying the region use US
for the US region and EU
for EU region.
Wrap the portion of your app inside HOC i.e Zonka Provider with token and region.
Identifying Logged in Visitors
If you have an app where users are able to log in or signup then you can add the following code to automatically add the contacts in Zonka Feedback. You can pass at least one of the following parameters to identify the users.
contact_name
string
"Josh Holland"
contact_email
string
"example@company.com"
contact_mobile
string
"+14532323223"
contact_uniqueid
string
"k2334"
Optional Parameters
Using sendDeviceDetails
(Optional)
sendDeviceDetails
(Optional)You can set the value of sendDeviceDetails
to true if you want to submit details of your device along with the Zonka Feedback survey response. This would send the details of the device such as OS, OS version, IP address, and type of device. When you implement SDK it’s true by default.// Some co
Using sendCustomAttributes
(Optional)
sendCustomAttributes
(Optional)You can pass additional data about your users to provide more meaningful data along with the response. Some of the examples can be screen name, order Id, or transaction Id which can be associated with the response.
Attributes can be used to do the following:
Identify respondents (by default survey responses are anonymous)
Trigger surveys
Filter survey result
Reset Visitor Attributes
If you are using the above code to identify users, then it might be a good idea to clear visitor data on logout. Use the below code to clear the data.
Last updated