Get images with various format
cURL
iOS SDK
Android SDK
PHP SDK
JS SDK
Flutter SDK
1
// Work in progress
Copied!
1
// Requests all images in the original format.
2
MBClient.getSection(withId: SECTION_ID,
3
parameters: [MBOriginalMediaParameter()],
4
success: { section in
5
6
},
7
failure: { error in
8
9
})
10
โ€‹
11
// Requests images with a thumb format.
12
MBClient.getSection(withId: SECTION_ID,
13
parameters: [MBImageFormatParameter(format: MBImageFormat.thumb)],
14
success: { section in
15
16
},
17
failure: { error in
18
19
})
Copied!
1
val arrayParameters = ArrayList<Any>()
2
arrayParameters.add(MBImageFormatParameter(format = IMAGE_FORMAT))
3
/*Use MBImageFormat, which is an enum with:
4
* --- ORIGINAL
5
* --- THUMB
6
* --- MEDIUM
7
* --- LARGE
8
*/
9
โ€‹
10
val sectionsListener = object: MBSectionsResultListener{
11
override fun onSectionsApiError(error: String) {
12
}
13
โ€‹
14
override fun onSectionsApiResult(sections: ArrayList<MBSection>,
15
block_id: Long,
16
paginationInfos: MBPaginationInfo) {
17
}
18
}
19
20
MBurgerTasks.askForSections(context = applicationContext,
21
block_id = BLOCK_ID,
22
filters = arrayParameters,
23
getElements = true,
24
listener = sectionsListener)
Copied!
1
// work in progress
Copied!
1
// work in progress
Copied!
1
// Requests all images in the original format.
2
MBPaginatedResponse<MBSection> sections =
3
await MBManager.shared.getSections(
4
blockId: BLOCK_ID,
5
parameters: [MBOriginalMediaParameter()],
6
);
7
โ€‹
8
// Requests images with a thumb format.
9
MBPaginatedResponse<MBSection> sections =
10
await MBManager.shared.getSections(
11
blockId: BLOCK_ID,
12
parameters: [MBImageFormatParameter(format: MBImageFormat.thumb)],
13
);
Copied!
Last modified 8mo ago
Copy link