HomeDocumentationAPI Reference
Getting StartedAPI ReferenceBug ReportingCrash ReportingAPMHelp Center
These docs are for v8.1. Click to read the latest docs for v12.0.0.

Set Will-Show-Survey Handler

This handler can be used to run a block of code right before a survey is shown to the user.

IBGSurveys.willShowSurveyHandler = {
    // Change some state
}
IBGSurveys.willShowSurveyHandler = ^{
    // Change some state
};
Surveys.setOnShowCallback(new Runnable() {
	@Override
	public void run() {
		//Pause game
	}
});
Surveys.onShowCallback(() => {
  //Perform any changes before the survey appears.
});
cordova.plugins.surveys.setOnShowHandler(() => {console.log('On show survey')}, (error) => {})
//iOS
IBGSurveys.WillShowSurveyHandler = () =>
{
  System.Console.WriteLine("New Survey");
};

//Android
Surveys.SetOnShowCallback(new IPreShowingSurveyRunnable());
public class IPreShowingSurveyRunnable : Java.Lang.Object, IOnShowCallback
{
  public void OnShow()
  {
    Android.Util.Log.Warn("PreShowingSurvey", "Pre Showing survey");
  }
}