Skip to content

Creating a GuideBlock

The CTXBaseGuideController class is the backbone of GuideBlocks and needs to be subclassed by your component in order to be used by the Contextual SDK.

Overridable Methods

There are two overridable methods which MUST be implemented for visually adding/removing the GuideBlock to/from the screen/viewport :

Method Description
presentGuideBlock This method is invoked by the Contextual SDK once a guide has satisified its trigger conditions and should be shown to the user. Details of the parameters of this method can be found below: PresentGuideBlock
isDismissingGuide This method is invoked by the Contextual SDK once a guide is being dismissed, either by a user or by the SDK itself, and as such you should ensure the guide is removed from the view hierarchy

State Model

The Contextual user experience allows for triggering, repeat and multiple steps in a guide sequence. When a guide is running, it has a state machine that moves the user through a flow. Each GuideBlock must adhere to these conventions to operate properly.

Contextual State Model

State Model Methods

Important

You are strongly recommended to implement all of these functions if you are making use of them. For example an affirmation button (such as "OK", "YES" etc) should trigger a nextStepOfGuide call.

The following methods provided by the base class so that you can easily:

  1. dismiss a guide,
  2. proceed to the next step of the guide,
  3. go back to the previous step of the guide (if any) and
  4. tap inside of or tap outside of the guide (the consequences of which are configured on the Contextual Dashboard on a per guide step basis)
Method Description
dismissGuide Informs the Contextual SDK that the guide should be dismissed
previousStepOfGuide Informs the Contextual SDK that it should go back to the previous step of the guide
nextStepOfGuide Informs the Contextual SDK that it should go to the next step of the guide
tapInsideOfGuide Informs the Contextual SDK that the guide has been tapped inside and it should perform whatever was configured on the "Tap inside" section of the Dashboard for this guide
tapOutsideOfGuide Informs the Contextual SDK that the guide has been tapped outside of the guide container and it should perform whatever was configured on the "Tap outside" section of the Dashboard for this guide

Last update: 2024-03-04