Android Mobile SDK: Notify Search Event

The "Notify Search Event" is used to report that a user has performed a search within the app. The notification is sent via the Mobile SDK using the Connectif.sendSearchEvent() method.

 

How to Use

The search event notification uses the searchQuery parameter to inform Connectif of the search performed by the user, and enriches the event with additional data automatically sent by the SDK.

As a recommendation, this event should be triggered right after the user submits a search within your app, to capture the query at the moment it is performed.

 

Notify Search Event

  • Search Info:
Attribute Definition Required Limitations
searchQuery The search term or phrase the user entered Yes First 100 characters are kept, the rest are discarded.

This type of event automatically collects the following information:

  • Operating system: Android or iOS.
  • App version.
  • Operating system version.
  • Connectif SDK version.

 

Example

The notification will look like this:

      Connectif.sendSearchEvent("smartphones")
 

Callbacks (Optional)

If you want feedback on potential errors when sending events, you can add an EventCallbacks when using our method.

 object : EventCallbacks {
    override fun onSuccess() {
        //Handle success
    }
    override fun onError(message: String?) {
         //Handle error
    }
}

 

Congratulations!
You've reached the end of the lesson.

 

Do you still have unresolved questions?
Remember that our Connectif specialists are available to assist you. To contact them, simply open a support ticket by clicking on the blue "Help" button in your dashboard.


Keep Learning!

To fully unlock the potential of your Connectif account, we recommend continuing with the following articles:

Was this article helpful?
0 out of 0 found this helpful