HomeDocumentationAPI Reference
Getting StartedAPI ReferenceHelp CenterVideo Tours

Set Pre-Invocation Handler

Use this handler to run any code prior to Instabug being invoked.

This block is executed on the UI thread and could be used for performing any UI changes before the SDK's UI is shown.

BugReporting.willInvokeHandler = {
    someObject.setSomeState()
}
IBGBugReporting.willInvokeHandler = ^{
    [someObject setSomeState];
};
BugReporting.setOnInvokeCallback(new OnInvokeCallback() {
            @Override
            public void onInvoke() {
               //do something
            }
};
BugReporting.OnInvokeHandler(function () {
    // Perform any UI changes before the SDK's UI is shown.
});
cordova.plugins.bugReporting.setOnInvokeHandler(
            function () {
                //Add any logic you want to do here
                console.log('On invocation logic');
            },
            function (error) {
                console.log('On Invoke handler could not be set ' + error);
            }
        );
//iOS
IBGBugReporting.WillInvokeHandler = () => 
{
  Console.WriteLine("SDK will be invoked!");
};

//Android
Instabug.SetOnSdkInvokedCallback(new IOnSdkInvokedCallbackClass());

private class IOnSdkInvokedCallbackClass : Java.Lang.Object, IOnSdkInvokedCallback
{
  public void OnSdkInvoked()
  {
    Android.Util.Log.Warn("OnSdkInvoked", "Instabug SDK invoked");
  }
}
BugReporting.setOnInvokeCallback(Function function);