The “Notify Page Visited” event is used to inform that the contact has visited any page. It notifies when a user visits your page through the use of the Connectif.sendPageVisit function.
How to Use
The page visited notification uses the pageName parameter, to enrich the information of the sent events, in addition to automatically sending additional information.
As a recommendation, the appropriate place should be the onResume lifecycle callback, which will allow us to know when a user has started using a specific view.
Notify Page Visited Event
- Page Info:
| Attribute | Definition | Required | Limitations |
|---|---|---|---|
| pageName | The name of the page being visited | Yes | Only the first 300 characters are taken; the rest are discarded. |
| tags | List of tags assigned to a page | No | Only the first 10 tags are taken; the rest are discarded. Each "tag" element can have a maximum value of 25 characters; additional characters are discarded. |
| categories | List of categories assigned to a page | No | Only the first 10 categories are taken; the rest are discarded. Each "category" element can have a maximum value of 256 characters; additional characters 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 simple notification will look like this.
Connectif.sendPageVisit("Home")The notification adding extra information will look like this.
Connectif.sendPageVisit(
PageVisit(
pageName = "Settings",
categories = listOf("Account", "Preferences"),
tags = listOf("settings", "profile")
)
)
Callbacks (Optional)
If you want feedback on possible errors when sending events, you can add an EventCallbacks when using our method.
object : EventCallbacks {
override fun onSuccess() {
//Handle success case
}
override fun onError(message: String?) {
//Handle error case
}
}
Keep Learning!
To make the most of your Connectif account, we recommend continuing with the following articles:
- Android SDK Get Started, to add Connectif Mobile SDK to your Android project.
- Firebase Cloud Messaging Setup, to enable push sending and receiving via the Android Mobile SDK.
- iOS SDK Get Started, to add Connectif Mobile SDK to your iOS project.
- Apple Push Notifications Service Setup, to enable push sending and receiving via the iOS Mobile SDK.