0

Our server API returns response as:

{
    "22397": {
        "granted": 1597078582,
        "expires": 0,
        "type": "video",
        "product_nid": 4029080241
    },
    "22313": {
        "granted": 1594318970,
        "expires": 0,
        "type": "video",
        "product_nid": 40208744145
    }
}

Here we don't know the "22397" or "22313" and are dynamic. Using Android Kotlin and Retrofit2.

  • can you show an example of code to start with? – Alberto Sinigaglia Apr 23 '21 at 15:14
  • also please check this https://stackoverflow.com/questions/53296312/retrofit-gson-with-dynamic-keys (imho, you should drop the use of retrofit for those objects and just use JSONObject, or switch to a another JSON structore on your backend if possible) – Alberto Sinigaglia Apr 23 '21 at 15:15

0 Answers0