added

[Android SDK] Added fields of PXLPhoto and postMedia API

Github: https://github.com/pixlee/android-sdk/releases/tag/1.8.2

A new field of PXLPhoto

#!java
public JSONObject uploaderAdditionalFields;
  • uploaderAdditionalFields is from connectedUser that can be uploaded via pxlKtxAlbum.postMediaWithFile() or pxlKtxAlbum.postMediaWithURI.

New addional fields for uploading content

  • productSKUs: List // Optional
  • categoryNames: List // Optional
  • connectedUser: JSONObject // Optional

Example

  • Option 1: Upload an image file
    #!kotlin
    pxlKtxAlbum.postMediaWithFile(
        localMediaPath = "<local file path>",
        title = "uploaded from SDK-" + System.currentTimeMillis() + " using a file",
        email = "[email protected]",
        username = "replace this with your user name",
        approved = true,
        productSKUs = listOf("productA", "productB"), // Optional
        categoryNames = listOf("Clothing", "Shoes"),  // Optional
        connectedUser = JSONObject().apply { // Optional
            put("name", "sample name")
            put("age", 24)
            put("points", JSONArray().apply {
                put(10)
                put(20)
                put(35)
            })
        })
    
  • Option 2: Upload an image url
    #!kotlin
    pxlKtxAlbum.postMediaWithURI(
            photoURI = "<photo URI>",
            title = "uploaded from SDK-" + System.currentTimeMillis() + " using a file",
            email = "[email protected]",
            username = "replace this with your user name",
            approved = true,
            productSKUs = listOf("productA", "productB"), // Optional
            categoryNames = listOf("Clothing", "Shoes"),  // Optional
            connectedUser = JSONObject().apply { // Optional
                put("name", "Sample name")
                put("age", 24)
                put("points", JSONArray().apply {
                    put(10)
                    put(20)
                    put(35)
                })
            })