In order to initialize SurveyWall, the following parameters should be passed in the initialization call: APP_ID, SECRET_KEY and USER_ID.
The call should look similar to:
public static final String YOUR_SV_APP_ID = ""; //set your value public static final String YOUR_SV_SECRET_KEY = ""; //set your value public static final String YOUR_SV_USER_ID = ""; //set your value OTSurveySettings.getInstance().configInit(YOUR_SV_APP_ID, YOUR_SV_SECRET_KEY, YOUR_SV_USER_ID);
- APPID and SECRET_KEY can be found in your OfferToro account, under your "App Placement" settings.
- UserID, is a parameter which should be passed from your end as an id for each end user of your app. A common practice is to use the Google Advertising ID (GAID) .
OfferToro SDK instances should be created in the activity by calling the following method:
After being successfully initialized, SurveyWall could be displayed into the app. For displaying the SurveyWall
showSurvey() method should be called:
The OfferToro SDK gives a possibility to be notified of events happening in the SurveyWall lifecycle via the SurveyWall listeners.
The following listeners are available:
onOTSurveyInitSuccess() - invoked when SurveyWall is successfully initialized;
onOTSurveyInitFail(string errorMessage) - invoked when SurveyWall initialization fails and receives (@param
errorMessage) describing the reason for fail;
onOTSurveyOpened() - invoked when SurveyWall is displayed;
onOTSurveyCredited(double credits, double totalCredits) - automatically invoked every several minutes and receives user’s balance (@param
totalCredits) and the amount of credits the user has earned (@param
credits) since the last update. The listener could also be updated at any point of time by calling
onOTSurveyClosed() - invoked when SurveyWall is closed.
To be notified of SurveyWall events
setSurveyListener(SurveyWallListener listener) method should be called:
OfferToro SDK supports two ways to reward your users. Those are:
The OfferToro SDK gives possibility to update the
onOTSurveyCredited() listener in SurveyWall lifecycle at any point of time by calling
getOTSurveyCredits() - updates
Server to Server postbacks is a more secured way to receive notifications, in order to rewarded your users.
To receive Server to Server postbacks, you must define your postback URL in your App Placement under your OfferToro account.
For more information - Please check this page.