region id
- setting up
regionId
can now be done globally in your application that extends Application.
- if you use multi-region, you can set your region id here(see the example below) to get photos, a photo, and products available in the region.
#!kotlin
class YourApplication: Application {
override fun onCreate() {
super.onCreate()
// initializing SDK
PXLClient.initialize(<your api key>, <your secret key>)
PXLClient.regionId = your region id <--- set it if you use multi-region.
}
}
Automatic Analytics
- Enabling Automatic Analytics can now be done globally.
- If you want to enable auto-anlaytics, you need
PXLClient.autoAnalyticsEnabled = true
in your application that extends Application. Then, these PXLPhotoRecyclerView, PXLPhotoRecyclerViewInGrid and PXLPhotoProductView will fire analytics automatically in the right moments.
which Events are related to Automatic Analytics?
- 'VisibleWidget' and 'OpenedWidget': PXLPhotoRecyclerView and PXLPhotoRecyclerViewInGrid
OpenedLightbox
: PXLPhotoProductView
NOTICE: Please be aware that you need to remove your implementation of these analytics events you fire manually in your app. Because these views handle the events for you if you enable it by PXLClient.autoAnalyticsEnabled = true
.
#!kotlin
class YourApplication: Application {
override fun onCreate() {
super.onCreate()
// initializing SDK
PXLClient.initialize(<your api key>, <your secret key>)
PXLClient.autoAnalyticsEnabled = true <----- This activates this feature
PXLClient.regionId = your region id <--- set it if you use multi-region.
}
}
class YourActivityOrFrament: Activity or Fragment {
// load this when you need
func setup() {
pxlPhotoProductView.setContent(...)
}
}