// 2️⃣ Build request body val payload = JSONObject().apply put("key", key) put("machineId", machineId) .toString()
/** * Handles verification of the license key against the remote server. * * The server expects a POST payload: * * "key": "<LICENSE_KEY>", * "machineId": "<MACHINE_ID>" // optional, may be empty string * * * Response (JSON): * * "valid": true */ object LicenseVerifier apeaksoft android toolkit registration code
// 6️⃣ Build the LicenseInfo object val expires = json.getString("expires") val features = json.getJSONArray("features") val featureSet = mutableSetOf<String>() for (i in 0 until features.length()) featureSet.add(features.getString(i)) // 2️⃣ Build request body val payload = JSONObject()
Now you can run:
dependencies // Core (free) components implementation "com.apeaksoft:android-toolkit-ui:1.4.2" * "machineId": "<
private const val LICENSE_ENDPOINT = "https://license.apeaksoft.com/validate" private val httpClient = OkHttpClient()