Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/distribute-develop-mission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
branch: ${{ github.base_ref }}
secrets:
GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
GITLAB_HOST: ${{ secrets.GITLAB_HOST }}
1 change: 1 addition & 0 deletions .github/workflows/distribute-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ jobs:
app_ref: ${{ inputs.app_ref }} # optional override for GitLab ref
secrets:
GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
GITLAB_HOST: ${{ secrets.GITLAB_HOST }}
1 change: 1 addition & 0 deletions .github/workflows/distribute-release-support-mission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ jobs:
branch: ${{ github.event.pull_request.head.ref }}
secrets:
GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
GITLAB_HOST: ${{ secrets.GITLAB_HOST }}
13 changes: 10 additions & 3 deletions .github/workflows/distribute-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
secrets:
GITLAB_TRIGGER_TOKEN:
required: true
GITLAB_HOST:
required: true

permissions:
contents: read
Expand Down Expand Up @@ -65,7 +67,7 @@ jobs:
- name: Trigger build workflow in react-native-app repo (override strict; else same->develop)
shell: bash
env:
GITLAB_HOST: mindbox.gitlab.yandexcloud.net
GITLAB_HOST: ${{ secrets.GITLAB_HOST }}
APP_PROJECT_ID: "1512"
DEFAULT_APP_REF: develop

Expand All @@ -77,6 +79,11 @@ jobs:
run: |
set -euo pipefail

if [[ -z "${GITLAB_HOST:-}" ]]; then
echo "::error::Secret GITLAB_HOST is empty: set it to the GitLab host name, without https://"
exit 1
fi

# Trim override so " " becomes empty
APP_REF_OVERRIDE="$(printf '%s' "${APP_REF_OVERRIDE:-}" | xargs)"

Expand Down Expand Up @@ -108,7 +115,7 @@ jobs:
tmp_body="$(mktemp)"

local code
code="$(curl -sS -o "$tmp_body" -w '%{http_code}' --location \
code="$(curl -sS -o "$tmp_body" -w '%{http_code}' \
--retry 3 --retry-all-errors --retry-delay 2 \
"https://${GITLAB_HOST}/api/v4/projects/${APP_PROJECT_ID}/trigger/pipeline" \
--form "token=${GITLAB_TRIGGER_TOKEN}" \
Expand All @@ -124,7 +131,7 @@ jobs:
echo "Response body:"
echo "$body"

if [[ "$code" == "200" || "$code" == "201" ]]; then
if [[ "$code" == "201" ]]; then
local web_url
web_url="$(
printf '%s\n' "$body" |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/manual-prepare_release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,12 @@ jobs:

##############################################################################
# 2) Android build.gradle: bump cloud.mindbox:mobile-sdk:<version>
# mindbox-common goes with it: it is an implementation dependency of mobile-sdk, so the
# wrapper takes it compileOnly and both must stay on the same version.
##############################################################################
echo "→ Bumping Android SDK in android/build.gradle"
sed -i "s|\(api 'cloud.mindbox:mobile-sdk:\).*|\1$AND_VER'|" android/build.gradle
sed -i "s|\(compileOnly 'cloud.mindbox:mindbox-common:\).*|\1$AND_VER'|" android/build.gradle
git add android/build.gradle

##############################################################################
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [Unreleased]

### Changes
- **Breaking since `2.16.0-rc`:** `onFail` of `MindboxEmbeddedBlock` reports failures only; a place with nothing to show arrives in the new `onEmpty`.
- **Breaking since `2.16.0-rc`:** the `MindboxEmbeddedBlockFailure` type is removed; `onFail` receives a `MindboxEmbeddedBlockFailReason` string instead of an empty object.
- **Breaking since `2.16.0-rc`:** `MindboxEmbeddedBlock` starts by `loadingStrategy="automatic"` — hidden until the place has shown content once on this device — instead of always showing a placeholder; `loadingStrategy="placeholder"` restores the previous look.
- Add `MindboxEmbeddedBlock` — an embedded block for a place from the admin panel, a native component for both the old and the new architecture.
- `MindboxEmbeddedBlock` reports three outcomes, as the native SwiftUI and Compose blocks do: `onLoad`, `onEmpty` and `onFail` with a `MindboxEmbeddedBlockFailReason` (`networkError` or `internalError`).
- `MindboxEmbeddedBlock` takes a `loadingStrategy` — `automatic` (the default: hidden until the place has shown content once on this device, a placeholder from then on), `placeholder` or `hidden` — and `animatesReveal`, as the native SwiftUI and Compose blocks do. A block that waited hidden grows to its height with the SDK's reveal when its content arrives.

## [2.16.0-rc] - 2026-09-11

### Changes
- Upgrade Android SDK dependency to v2.16.0-rc
- Upgrade iOS SDK dependency to v2.16.0-rc


## [2.15.3] - 2026-08-26

### Changes
Expand Down
11 changes: 8 additions & 3 deletions MindboxSdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ Pod::Spec.new do |s|

s.source_files = "ios/**/*.{h,m,mm,swift}"

s.dependency "React-Core"
s.dependency "Mindbox", "2.16.0-rc"
s.dependency "MindboxNotifications", "2.16.0-rc"

s.dependency "Mindbox", "2.15.3"
s.dependency "MindboxNotifications", "2.15.3"
# Only this call defines RCT_NEW_ARCH_ENABLED for the pod, which MindboxEmbeddedBlockView.mm splits on.
if respond_to?(:install_modules_dependencies, true)
install_modules_dependencies(s)
else
s.dependency "React-Core"
end
end
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Follow the installation process detailed [here](https://developers.mindbox.ru/do
```markdown
npm i --save mindbox-sdk
```
The package requires React Native 0.71 or newer, on the old or the new architecture.

2. For iOS, make sure to install the pods:
```markdown
Expand Down
5 changes: 4 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ buildscript {

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: "com.facebook.react"

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['MindboxSdk_' + name]
Expand Down Expand Up @@ -126,5 +127,7 @@ dependencies {
// noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
api 'cloud.mindbox:mobile-sdk:2.15.4'
api 'cloud.mindbox:mobile-sdk:2.16.0-rc'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.7"
compileOnly 'cloud.mindbox:mindbox-common:2.16.0-rc'
}
3 changes: 2 additions & 1 deletion android/src/main/java/com/mindboxsdk/MindboxSdkPackage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.facebook.react.ReactPackage
import com.facebook.react.bridge.NativeModule
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.uimanager.ViewManager
import com.mindboxsdk.embedded.MindboxEmbeddedBlockViewManager


class MindboxSdkPackage : ReactPackage {
Expand All @@ -12,6 +13,6 @@ class MindboxSdkPackage : ReactPackage {
}

override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
return emptyList()
return listOf(MindboxEmbeddedBlockViewManager())
}
}
26 changes: 26 additions & 0 deletions android/src/main/java/com/mindboxsdk/embedded/EmbeddedBlockWire.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.mindboxsdk.embedded

import cloud.mindbox.mobile_sdk.annotations.InternalMindboxApi
import cloud.mindbox.mobile_sdk.embedded.MindboxEmbeddedBlockAppearance
import cloud.mindbox.mobile_sdk.embedded.MindboxEmbeddedBlockLoadingStrategy

@OptIn(InternalMindboxApi::class)
internal object EmbeddedBlockWire {
const val OUTCOME_LOAD = "load"
const val OUTCOME_EMPTY = "empty"
const val OUTCOME_FAIL = "fail"

fun loadingStrategyOf(word: String?): MindboxEmbeddedBlockLoadingStrategy? = when (word) {
null, "", "automatic" -> MindboxEmbeddedBlockLoadingStrategy.AUTOMATIC
"placeholder" -> MindboxEmbeddedBlockLoadingStrategy.PLACEHOLDER
"hidden" -> MindboxEmbeddedBlockLoadingStrategy.HIDDEN
else -> null
}

fun nameOf(appearance: MindboxEmbeddedBlockAppearance): String = when (appearance) {
MindboxEmbeddedBlockAppearance.PLACEHOLDER -> "placeholder"
MindboxEmbeddedBlockAppearance.CONTENT -> "content"
MindboxEmbeddedBlockAppearance.ERROR -> "error"
MindboxEmbeddedBlockAppearance.COLLAPSED -> "collapsed"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.mindboxsdk.embedded

import com.facebook.react.bridge.Arguments
import com.facebook.react.bridge.WritableMap
import com.facebook.react.uimanager.events.Event

internal class AppearanceChangeEvent(
surfaceId: Int,
viewTag: Int,
private val appearance: String,
private val isRevealAnimated: Boolean,
private val revealDurationMs: Int,
) : Event<AppearanceChangeEvent>(surfaceId, viewTag) {
override fun getEventName(): String = EVENT_NAME

// React Native keeps only the last queued event of a name per view; JS needs every look change.
override fun canCoalesce(): Boolean = false

override fun getEventData(): WritableMap = Arguments.createMap().apply {
putString("appearance", appearance)
putBoolean("animated", isRevealAnimated)
putInt("revealDurationMs", if (isRevealAnimated) revealDurationMs else 0)
}

companion object {
const val EVENT_NAME = "topAppearanceChange"
}
}

internal class BlockOutcomeEvent(
surfaceId: Int,
viewTag: Int,
private val outcome: String,
private val reason: String?,
) : Event<BlockOutcomeEvent>(surfaceId, viewTag) {
override fun getEventName(): String = EVENT_NAME

// React Native keeps only the last queued event of a name per view; JS needs every outcome.
override fun canCoalesce(): Boolean = false

override fun getEventData(): WritableMap = Arguments.createMap().apply {
putString("outcome", outcome)
putString("reason", reason.orEmpty())
}

companion object {
const val EVENT_NAME = "topBlockOutcome"
}
}
Loading
Loading