Skip to content

Added region id

Compare
Choose a tag to compare
@SungjunApp SungjunApp released this 23 Dec 03:18
· 22 commits to master since this release
09a07f9

This release is for those who have multi regions. You can now get photos from a specific region and differentiate analytics events by region.

initiation

#!Kotlin
val pxlKtxAlbum = PXLKtxAlbum(context)
val searchId = PXLKtxBaseAlbum.SearchId.Album("<your ALBUM ID>")
pxlKtxAlbum.params = PXLKtxBaseAlbum.Params(
     searchId = searchId
)
pxlKtxAlbum.params = PXLKtxBaseAlbum.Params(
    searchId = searchId,
    perPage = 30,
    filterOptions = PXLAlbumFilterOptions().apply {
        hasPermission = true
        hasProduct = true
        // ... there's more
    },
    sortOptions = PXLAlbumSortOptions().apply {
        sortType = PXLAlbumSortType.RECENCY
        descending = true
        // ... there's more.
    },
    regionId = <Optional: your region id(Int)>       //<-------------- HERE is where you need to add your region id (Optional). If you don't know your region ids, please ask your account manager to give you it. 
)

region id related APIs

Get the first page

#!Kotlin
val result = pxlKtxAlbum.getFirstPage()

Get the next pages

#!Kotlin
val result = pxlKtxAlbum.getNextPage()

Get PXLPhoto from default region

  • if you have multi regions, your default region is set on the server. to get more detail about your default region, please reach out your customer success manager
#!Kotlin.coroutines

val albumPhotoId:String = <one of your album photo ids>
val result:PXLPhoto = pxlKtxAlbum.getPhotoWithId(albumPhotoId)

Get a PXLPhoto from a region

  • before firing this, you must basically add region when setting up pxlKtxAlbum.params
#!Kotlin.coroutines

val albumPhotoId:String = <one of your album photo ids>
val result:PXLPhoto = pxlKtxAlbum.getPhotoFromRegion(albumPhotoId)

all analytics APIs are related to region id

  • Step 1: get through the initiation process at the top of this release note to set region id
  • Step 2: fire analytics APIs