Send or schedule a push when creating a section
cURL
iOS SDK
Android SDK
PHP SDK
JS SDK
Flutter SDK
1
https://mburger.cloud/api/blocks/<id>/sections
2
-X POST
3
-H "Accept: application/json"
4
-H "Content-Type: application/x-www-form-urlencoded"
5
-H "X-MBurger-Token: <token>"
6
-H "X-MBurger-Version: 3"
7
-d 'elements[<locale>][<element_type>]=<value>'
8
-d 'want_push'
Copied!
1
MBAdmin.addSectionToBlock(withBlockId: BLOCK_ID,
2
elements: elements,
3
pushSettings: MBAdminPushSettings(wantsPush: true,
4
pushBody: "BODY_OF_THE_PUSH"),
5
success: { sectionId in
6
7
},
8
failure: { error in
9
10
})
Copied!
1
val params = ArrayList<MBAdminGenericParameter>()
2
//Add it only if you want to send a push, body can be null
3
params.add(MBAdminPushSettingsParameter(push_body = BODY_OF_THE_PUSH))
4
5
val addSectionListener = object: MBAdminAddSectionListener{
6
override fun onSectionAdded(section_id: Long) {
7
}
8
9
override fun onSectionAddedError(error: String) {
10
}
11
}
12
13
MBurgerAdminTasks.addSection(
14
context = applicationContext,
15
block_id = BLOCK_ID,
16
listener = addSectionListener,
17
params = params,
18
locale = Locale.getDefault().getLanguage());
Copied!
1
// Work in progress
Copied!
1
// POST actions are not available atm on our JS SDK.
2
// If it could be interesting for you, please submit
3
// a feature request here:
4
// https://support.mburger.cloud/hc/en-us/community/topics/360000550497-Feature-Request?
Copied!
1
await MBAdmin.shared.addSectionToBlock(
2
BLOCK_ID,
3
elements,
4
pushSettings: MBAdminPushSettings(
5
wantsPush: true,
6
pushBody: 'BODY_OF_THE_PUSH',
7
),
8
);
Copied!
Last modified 8mo ago
Copy link