diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..e8b6f5ed --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + day: "monday" + time: "06:00" + timezone: "UTC" + open-pull-requests-limit: 1 + groups: + github-actions: + patterns: ["*"] + commit-message: + prefix: "deps" + include: "scope" diff --git a/.github/git-release-ci.sh b/.github/git-release-ci.sh new file mode 100755 index 00000000..9b1d952b --- /dev/null +++ b/.github/git-release-ci.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Creates a GitHub release for a single Flutter SDK package. +# Flutter SDK is a monorepo of independently-versioned packages, so this is +# called once per published package (mindbox, mindbox_android, mindbox_ios, +# mindbox_platform_interface) with that package's tag/title. +# +# Usage: git-release-ci.sh <branch> +tag="${1:?usage: git-release-ci.sh <tag> <title> <branch>}" +title="${2:?usage: git-release-ci.sh <tag> <title> <branch>}" +branch="${3:?usage: git-release-ci.sh <tag> <title> <branch>}" + +notes="Auto-generated release. Check more details at [Mindbox Flutter SDK Documentation](https://developers.mindbox.ru/docs/flutter-sdk)" + +# Idempotent: a re-run of a release must not fail on an already-published tag. +if gh release view "$tag" >/dev/null 2>&1; then + echo "Release $tag already exists — skipping." + exit 0 +fi + +echo "Creating release $tag on branch $branch" +gh release create "$tag" --target "$branch" --title "$title" --notes "$notes" diff --git a/.github/workflows/analyze_and_test.yml b/.github/workflows/analyze_and_test.yml index c8bfa001..090211a9 100644 --- a/.github/workflows/analyze_and_test.yml +++ b/.github/workflows/analyze_and_test.yml @@ -16,18 +16,18 @@ on: required: true type: string +permissions: + contents: read + jobs: platform_interface_flutter_test: name: platform_interface running analyze and tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ inputs.branch || github.head_ref }} - - uses: actions/setup-java@v1 - with: - java-version: "12.x" - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 with: channel: "stable" - name: Add publish_to tag @@ -41,13 +41,10 @@ jobs: name: android_component running analyze and tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ inputs.branch || github.head_ref }} - - uses: actions/setup-java@v1 - with: - java-version: "12.x" - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 with: channel: "stable" - name: Add publish_to tag @@ -64,13 +61,10 @@ jobs: name: ios_component running analyze and tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ inputs.branch || github.head_ref }} - - uses: actions/setup-java@v1 - with: - java-version: "12.x" - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 with: channel: "stable" - name: Add publish_to tag @@ -87,13 +81,10 @@ jobs: name: example running analyze runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ inputs.branch || github.head_ref }} - - uses: actions/setup-java@v1 - with: - java-version: "12.x" - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 with: channel: "stable" @@ -104,13 +95,10 @@ jobs: name: plugin running analyze and tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ inputs.branch || github.head_ref }} - - uses: actions/setup-java@v1 - with: - java-version: "12.x" - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 with: channel: "stable" diff --git a/.github/workflows/distribute-develop-mission.yml b/.github/workflows/distribute-develop-mission.yml index ad456db1..1ada48d2 100644 --- a/.github/workflows/distribute-develop-mission.yml +++ b/.github/workflows/distribute-develop-mission.yml @@ -8,10 +8,14 @@ on: types: - closed +permissions: + contents: read + jobs: call-reusable: if: ${{ github.event.pull_request.merged == true }} uses: ./.github/workflows/distribute-reusable.yml with: branch: ${{ github.base_ref }} - secrets: inherit + secrets: + GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }} diff --git a/.github/workflows/distribute-manual.yml b/.github/workflows/distribute-manual.yml index 13984e5a..49c8ecf0 100644 --- a/.github/workflows/distribute-manual.yml +++ b/.github/workflows/distribute-manual.yml @@ -8,10 +8,14 @@ on: required: false default: "" +permissions: + contents: read + jobs: call-reusable: uses: ./.github/workflows/distribute-reusable.yml with: branch: ${{ github.ref_name }} # SDK branch = current branch app_ref: ${{ inputs.app_ref }} # optional override for GitLab ref - secrets: inherit + secrets: + GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }} diff --git a/.github/workflows/distribute-release-support-mission.yml b/.github/workflows/distribute-release-support-mission.yml index 06ffa4cb..0c22fc87 100644 --- a/.github/workflows/distribute-release-support-mission.yml +++ b/.github/workflows/distribute-release-support-mission.yml @@ -10,10 +10,14 @@ on: - opened - synchronize +permissions: + contents: read + jobs: call-reusable: if: ${{ startsWith(github.event.pull_request.head.ref, 'release/') }} uses: ./.github/workflows/distribute-reusable.yml with: branch: ${{ github.event.pull_request.head.ref }} - secrets: inherit + secrets: + GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }} diff --git a/.github/workflows/distribute-reusable.yml b/.github/workflows/distribute-reusable.yml index 98a72fba..4e24c1ea 100644 --- a/.github/workflows/distribute-reusable.yml +++ b/.github/workflows/distribute-reusable.yml @@ -14,12 +14,15 @@ on: GITLAB_TRIGGER_TOKEN: required: true +permissions: + contents: read + jobs: trigger: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ inputs.branch }} fetch-depth: 3 @@ -29,9 +32,12 @@ jobs: run: | set -euo pipefail commits="$(git log -3 --pretty=format:"%s")" - echo "commits<<EOF" >> "$GITHUB_ENV" - echo "$commits" >> "$GITHUB_ENV" - echo "EOF" >> "$GITHUB_ENV" + delim="EOF_$(openssl rand -hex 8)" + { + echo "commits<<$delim" + echo "$commits" + echo "$delim" + } >> "$GITHUB_ENV" - name: Debug payload that will be sent to GitLab shell: bash diff --git a/.github/workflows/gitleaks-secrets-validate.yml b/.github/workflows/gitleaks-secrets-validate.yml index 0ad5ccb1..31312bc2 100644 --- a/.github/workflows/gitleaks-secrets-validate.yml +++ b/.github/workflows/gitleaks-secrets-validate.yml @@ -2,18 +2,22 @@ name: Gitleaks Secrets Validate on: pull_request: workflow_dispatch: + +permissions: + contents: read + jobs: scan: name: gitleaks runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 - name: Run Gitleaks - uses: gitleaks/gitleaks-action@v2 + uses: gitleaks/gitleaks-action@e0c47f4f8be36e29cdc102c57e68cb5cbf0e8d1e # v3.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITLEAKS_LICENSE: ${{ secrets.MINDBOX_GITLEAKS_LICENSE }} + GITLEAKS_LICENSE: ${{ secrets.MINDBOX_GITLEAKS_LICENSE }} diff --git a/.github/workflows/manual-prepare_release_branch.yml b/.github/workflows/manual-prepare_release_branch.yml index 9994bb06..20c62585 100644 --- a/.github/workflows/manual-prepare_release_branch.yml +++ b/.github/workflows/manual-prepare_release_branch.yml @@ -23,14 +23,18 @@ on: required: true default: 'master' +permissions: + contents: read + jobs: validate-input: name: Validate versions format runs-on: ubuntu-latest steps: - name: Check release_version matches semver + env: + V: ${{ github.event.inputs.release_version }} run: | - V=${{ github.event.inputs.release_version }} echo "Input release_version=$V" if ! [[ "$V" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc)?$ ]]; then echo "❌ release_version must be X.Y.Z or X.Y.Z-rc" @@ -38,8 +42,9 @@ jobs: fi - name: Validate Android SDK version if provided if: ${{ github.event.inputs.android_sdk_version != '' }} + env: + A: ${{ github.event.inputs.android_sdk_version }} run: | - A=${{ github.event.inputs.android_sdk_version }} echo "Input android_sdk_version=$A" if ! [[ "$A" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc)?$ ]]; then echo "❌ android_sdk_version must be X.Y.Z or X.Y.Z-rc" @@ -47,8 +52,9 @@ jobs: fi - name: Validate iOS SDK version if provided if: ${{ github.event.inputs.ios_sdk_version != '' }} + env: + I: ${{ github.event.inputs.ios_sdk_version }} run: | - I=${{ github.event.inputs.ios_sdk_version }} echo "Input ios_sdk_version=$I" if ! [[ "$I" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc)?$ ]]; then echo "❌ ios_sdk_version must be X.Y.Z or X.Y.Z-rc" @@ -61,22 +67,24 @@ jobs: needs: validate-input steps: - name: Checkout minimal repo - uses: actions/checkout@v4 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 - name: Check source branch + env: + SRC: ${{ github.event.inputs.source_branch }} run: | - SRC=${{ github.event.inputs.source_branch }} echo "Source branch: $SRC" - if ! git ls-remote --heads origin "$SRC" | grep -q "$SRC"; then + if [ -z "$(git ls-remote --heads origin "refs/heads/$SRC")" ]; then echo "❌ source_branch '$SRC' does not exist" exit 1 fi - name: Check target branch + env: + DST: ${{ github.event.inputs.target_branch }} run: | - DST=${{ github.event.inputs.target_branch }} echo "Target branch: $DST" - if ! git ls-remote --heads origin "$DST" | grep -q "$DST"; then + if [ -z "$(git ls-remote --heads origin "refs/heads/$DST")" ]; then echo "❌ target_branch '$DST' does not exist" exit 1 fi @@ -85,11 +93,13 @@ jobs: name: Create release branch & bump versions runs-on: ubuntu-latest needs: validate-branches + permissions: + contents: write outputs: release_branch: ${{ steps.bump.outputs.release_branch }} steps: - name: Checkout source branch - uses: actions/checkout@v4 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ github.event.inputs.source_branch }} fetch-depth: 0 @@ -101,12 +111,13 @@ jobs: - name: Create branch and update versions id: bump + env: + VERSION: ${{ github.event.inputs.release_version }} + AND_VER: ${{ github.event.inputs.android_sdk_version }} + IO_VER: ${{ github.event.inputs.ios_sdk_version }} + SRC: ${{ github.event.inputs.source_branch }} run: | set -euo pipefail - VERSION="${{ github.event.inputs.release_version }}" - AND_VER="${{ github.event.inputs.android_sdk_version }}" - IO_VER="${{ github.event.inputs.ios_sdk_version }}" - SRC="${{ github.event.inputs.source_branch }}" REL="release/$VERSION" echo "Parameters before fallback: AND_VER=$AND_VER, IO_VER=$IO_VER" @@ -158,6 +169,9 @@ jobs: sed -i "s/cloud.mindbox:mobile-sdk:.*/cloud.mindbox:mobile-sdk:$AND_VER'/" mindbox_android/android/build.gradle echo " After:" && grep "cloud.mindbox:mobile-sdk" mindbox_android/android/build.gradle || true + # Fail the release if a version substitution didn't land (stale pin). + assert_pin() { grep -qE "$2" "$1" || { echo "ERROR: pattern /$2/ not found in $1 — substitution failed"; exit 1; }; } + echo "→ Bumping iOS native SDK in podspec" echo " Before s.version:" && grep -E "s\.version" mindbox_ios/ios/mindbox_ios.podspec || true sed -i -E "s/(s\.version *= *')[^']+(')/\1$IO_VER\2/" mindbox_ios/ios/mindbox_ios.podspec @@ -166,10 +180,18 @@ jobs: echo " Before Mindbox dependency:" && grep "s.dependency 'Mindbox'," mindbox_ios/ios/mindbox_ios.podspec || true sed -i -E "s/(s\.dependency 'Mindbox', *')[^']+(')/\1$IO_VER\2/" mindbox_ios/ios/mindbox_ios.podspec echo " After Mindbox dependency:" && grep "s.dependency 'Mindbox'," mindbox_ios/ios/mindbox_ios.podspec || true + assert_pin mindbox_ios/ios/mindbox_ios.podspec "s\.dependency 'Mindbox', *'$IO_VER'" echo " Before Notifications dep:" && grep "MindboxNotifications" mindbox_ios/ios/mindbox_ios.podspec || true sed -i -E "s/(s\.dependency 'MindboxNotifications', *')[^']+(')/\1$IO_VER\2/" mindbox_ios/ios/mindbox_ios.podspec echo " After Notifications dep:" && grep "MindboxNotifications" mindbox_ios/ios/mindbox_ios.podspec || true + assert_pin mindbox_ios/ios/mindbox_ios.podspec "s\.dependency 'MindboxNotifications', *'$IO_VER'" + + echo "→ Bumping ios-sdk exact pin in SPM manifest" + echo " Before:" && grep "mindbox-cloud/ios-sdk" mindbox_ios/ios/mindbox_ios/Package.swift || true + sed -i "/mindbox-cloud\/ios-sdk/ s/exact: \"[^\"]*\"/exact: \"$IO_VER\"/" mindbox_ios/ios/mindbox_ios/Package.swift + echo " After:" && grep "mindbox-cloud/ios-sdk" mindbox_ios/ios/mindbox_ios/Package.swift || true + assert_pin mindbox_ios/ios/mindbox_ios/Package.swift "exact: *\"$IO_VER\"" echo "→ Now inspect pubspec.yaml versions:" echo " mindbox/pubspec.yaml:" && grep "^version\|mindbox_" mindbox/pubspec.yaml || true @@ -207,13 +229,16 @@ jobs: mindbox_ios/pubspec.yaml \ mindbox_platform_interface/pubspec.yaml \ mindbox_android/android/build.gradle \ - mindbox_ios/ios/mindbox_ios.podspec + mindbox_ios/ios/mindbox_ios.podspec \ + mindbox_ios/ios/mindbox_ios/Package.swift git commit -m "Bump SDK versions: Flutter=$VERSION, Android=$AND_VER, iOS=$IO_VER" - echo "release_branch=$REL" >> $GITHUB_OUTPUT + echo "release_branch=$REL" >> "$GITHUB_OUTPUT" - name: Push release branch - run: git push --set-upstream origin ${{ steps.bump.outputs.release_branch }} + env: + REL: ${{ steps.bump.outputs.release_branch }} + run: git push --set-upstream origin "$REL" create_pull_request: name: Create Pull Request @@ -226,20 +251,21 @@ jobs: SRC: ${{ needs.bump_and_branch.outputs.release_branch }} DST: ${{ github.event.inputs.target_branch }} REPO: ${{ github.repository }} + RELEASE_VERSION: ${{ github.event.inputs.release_version }} + AND_VER: ${{ github.event.inputs.android_sdk_version }} + IO_VER: ${{ github.event.inputs.ios_sdk_version }} run: | - AND_VER=${{ github.event.inputs.android_sdk_version }} - IO_VER=${{ github.event.inputs.ios_sdk_version }} - [ -z "$AND_VER" ] && AND_VER="${{ github.event.inputs.release_version }}" - [ -z "$IO_VER" ] && IO_VER="${{ github.event.inputs.release_version }}" - + [ -z "$AND_VER" ] && AND_VER="$RELEASE_VERSION" + [ -z "$IO_VER" ] && IO_VER="$RELEASE_VERSION" + BODY=$( - printf 'Automated PR: merge `%s` into `%s`\n\n**Versions:**\n- Flutter SDK: `%s`\n- Android SDK: `%s`\n- iOS SDK: `%s`' \ - "$SRC" "$DST" "${{ github.event.inputs.release_version }}" "$AND_VER" "$IO_VER" + printf "Automated PR: merge \`%s\` into \`%s\`\n\n**Versions:**\n- Flutter SDK: \`%s\`\n- Android SDK: \`%s\`\n- iOS SDK: \`%s\`" \ + "$SRC" "$DST" "$RELEASE_VERSION" "$AND_VER" "$IO_VER" ) gh pr create \ --repo "$REPO" \ --base "$DST" \ --head "$SRC" \ - --title "Release ${{ github.event.inputs.release_version }}" \ + --title "Release $RELEASE_VERSION" \ --body "$BODY" diff --git a/.github/workflows/pr-description-validate.yml b/.github/workflows/pr-description-validate.yml index af3a1f3e..8ff6af5d 100644 --- a/.github/workflows/pr-description-validate.yml +++ b/.github/workflows/pr-description-validate.yml @@ -3,20 +3,24 @@ name: Validate PR description is not empty on: pull_request: types: [opened, edited, reopened, synchronize] - issue_comment: - types: [created] + +permissions: + contents: read jobs: check-description: runs-on: ubuntu-latest - if: ${{ github.event_name == 'pull_request' || github.event.issue.pull_request }} + permissions: + contents: read + pull-requests: write + issues: write steps: - name: Check out the repository - uses: actions/checkout@v4 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Check PR description id: validate_description_step - uses: actions/github-script@v7 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -28,7 +32,7 @@ jobs: core.setOutput('pr_description_check_passed', 'true'); } - name: Find Comment - uses: peter-evans/find-comment@v3 + uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0 id: fc with: issue-number: ${{ github.event.pull_request.number }} @@ -36,7 +40,7 @@ jobs: - name: Update comment with validation failed statement if: ${{ steps.validate_description_step.outputs.pr_description_check_passed == 'false' }} - uses: peter-evans/create-or-update-comment@v4 + uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 with: issue-number: ${{ github.event.pull_request.number }} comment-id: ${{ steps.fc.outputs.comment-id }} diff --git a/.github/workflows/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml index ff89255d..0757703b 100644 --- a/.github/workflows/publish-dry-run.yml +++ b/.github/workflows/publish-dry-run.yml @@ -6,6 +6,9 @@ on: branches: - 'publish-dry-run/**' +permissions: + contents: read + jobs: dry-run-publish: runs-on: ubuntu-latest @@ -20,14 +23,14 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - - uses: subosito/flutter-action@v2 + - uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2.23.0 with: channel: stable - name: Dry run publish - uses: sakebook/actions-flutter-pub-publisher@v1.3.1 + uses: sakebook/actions-flutter-pub-publisher@ccd9fbba502ea7ef33ea2479e0cdac5a2a9766e1 # v1.4.1 with: package_directory: ${{ matrix.package }} credential: ${{ secrets.PUB_CREDENTIALS }} diff --git a/.github/workflows/publish-from-master-or-support.yml b/.github/workflows/publish-from-master-or-support.yml index adebf2ed..15affe33 100644 --- a/.github/workflows/publish-from-master-or-support.yml +++ b/.github/workflows/publish-from-master-or-support.yml @@ -7,10 +7,17 @@ on: - 'master' - 'support/*' +permissions: + contents: read + jobs: call-reusable: if: ${{ github.event.pull_request.merged == true }} + permissions: + contents: write uses: ./.github/workflows/publish-reusable.yml with: branch: ${{ github.base_ref }} - secrets: inherit + secrets: + PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }} + PAT_FOR_TRIGGERING_BRANCH_PROTECTION: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }} diff --git a/.github/workflows/publish-manual.yml b/.github/workflows/publish-manual.yml index c4f2669f..61abf52e 100644 --- a/.github/workflows/publish-manual.yml +++ b/.github/workflows/publish-manual.yml @@ -3,20 +3,29 @@ name: SDK publish RC manual on: workflow_dispatch: +permissions: + contents: read + jobs: check-branch: runs-on: ubuntu-latest steps: - name: Check if branch matches pattern + env: + REF_NAME: ${{ github.ref_name }} run: | - if ! echo "${{ github.ref_name }}" | grep -q "release/.*-rc"; then + if ! echo "$REF_NAME" | grep -q "release/.*-rc"; then echo "Branch name must match pattern 'release/*-rc' (e.g. release/2.13.2-rc)" exit 1 fi call-publish-reusable: needs: check-branch + permissions: + contents: write uses: ./.github/workflows/publish-reusable.yml with: branch: ${{ github.ref_name }} - secrets: inherit + secrets: + PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }} + PAT_FOR_TRIGGERING_BRANCH_PROTECTION: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }} diff --git a/.github/workflows/publish-reusable.yml b/.github/workflows/publish-reusable.yml index 62570cfc..34ee134c 100644 --- a/.github/workflows/publish-reusable.yml +++ b/.github/workflows/publish-reusable.yml @@ -6,6 +6,14 @@ on: branch: required: true type: string + secrets: + PUB_CREDENTIALS: + required: true + PAT_FOR_TRIGGERING_BRANCH_PROTECTION: + required: true + +permissions: + contents: read jobs: analyze_and_test: @@ -13,31 +21,35 @@ jobs: uses: ./.github/workflows/analyze_and_test.yml with: branch: ${{ inputs.branch }} - secrets: inherit platform_interface_publish: needs: [analyze_and_test] timeout-minutes: 4 runs-on: ubuntu-latest name: mindbox_platform_interface publishing + permissions: + contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 2 ref: ${{ inputs.branch }} - name: Check package Pubspec id: pubspec + env: + HEAD_SHA: ${{ github.sha }} run: | set +e - git diff-tree --no-commit-id --name-only -r HEAD~1 ${{ github.sha }} | grep 'mindbox_platform_interface/pubspec.yaml' - echo ::set-output name=changed::$? + git diff-tree --no-commit-id --name-only -r HEAD~1 "$HEAD_SHA" | grep 'mindbox_platform_interface/pubspec.yaml' + rc=$? set -e + echo "changed=$rc" >> "$GITHUB_OUTPUT" - name: Extract package version if: steps.pubspec.outputs.changed == 0 run: | cd mindbox_platform_interface - echo "VERSION=$(awk '{if ($1 ~ /^version:/) print $2}' pubspec.yaml)" >> $GITHUB_ENV - - uses: sakebook/actions-flutter-pub-publisher@v1.3.1 + echo "VERSION=$(awk '{if ($1 ~ /^version:/) print $2}' pubspec.yaml)" >> "$GITHUB_ENV" + - uses: sakebook/actions-flutter-pub-publisher@ccd9fbba502ea7ef33ea2479e0cdac5a2a9766e1 # v1.4.1 if: steps.pubspec.outputs.changed == 0 with: package_directory: mindbox_platform_interface @@ -46,16 +58,11 @@ jobs: skip_test: true - name: Create Release if: steps.pubspec.outputs.changed == 0 - id: create_release - uses: actions/create-release@v1.1.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: mindbox_platform_interface-v${{ env.VERSION }} - release_name: mindbox_platform_interface v${{ env.VERSION }} - draft: false - prerelease: false - + BRANCH: ${{ inputs.branch }} + run: ./.github/git-release-ci.sh "mindbox_platform_interface-v$VERSION" "mindbox_platform_interface v$VERSION" "$BRANCH" + waiting-while-platform-interface-publish: needs: [platform_interface_publish] runs-on: ubuntu-latest @@ -68,6 +75,8 @@ jobs: timeout-minutes: 4 runs-on: ubuntu-latest name: ${{ matrix.package }} publishing + permissions: + contents: write strategy: matrix: package: @@ -76,23 +85,29 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 2 ref: ${{ inputs.branch }} - name: Check package Pubspec id: pubspec + env: + HEAD_SHA: ${{ github.sha }} + PKG: ${{ matrix.package }} run: | set +e - git diff-tree --no-commit-id --name-only -r HEAD~1 ${{ github.sha }} | grep '${{ matrix.package }}/pubspec.yaml' - echo ::set-output name=changed::$? + git diff-tree --no-commit-id --name-only -r HEAD~1 "$HEAD_SHA" | grep "$PKG/pubspec.yaml" + rc=$? set -e + echo "changed=$rc" >> "$GITHUB_OUTPUT" - name: Extract package version if: steps.pubspec.outputs.changed == 0 + env: + PKG: ${{ matrix.package }} run: | - cd ${{ matrix.package }} - echo "VERSION=$(awk '{if ($1 ~ /^version:/) print $2}' pubspec.yaml)" >> $GITHUB_ENV - - uses: sakebook/actions-flutter-pub-publisher@v1.3.1 + cd "$PKG" + echo "VERSION=$(awk '{if ($1 ~ /^version:/) print $2}' pubspec.yaml)" >> "$GITHUB_ENV" + - uses: sakebook/actions-flutter-pub-publisher@ccd9fbba502ea7ef33ea2479e0cdac5a2a9766e1 # v1.4.1 if: steps.pubspec.outputs.changed == 0 with: package_directory: ${{ matrix.package }} @@ -101,16 +116,12 @@ jobs: skip_test: true - name: Create Release if: steps.pubspec.outputs.changed == 0 - id: create_release - uses: actions/create-release@v1.1.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ matrix.package }}-v${{ env.VERSION }} - release_name: ${{ matrix.package }} v${{ env.VERSION }} - draft: false - prerelease: false - + BRANCH: ${{ inputs.branch }} + PKG: ${{ matrix.package }} + run: ./.github/git-release-ci.sh "$PKG-v$VERSION" "$PKG v$VERSION" "$BRANCH" + waiting-while-native_components_publish: needs: [native_components_publish] runs-on: ubuntu-latest @@ -123,24 +134,29 @@ jobs: timeout-minutes: 4 runs-on: ubuntu-latest name: mindbox publishing + permissions: + contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 2 ref: ${{ inputs.branch }} - name: Check package Pubspec id: pubspec + env: + HEAD_SHA: ${{ github.sha }} run: | set +e - git diff-tree --no-commit-id --name-only -r HEAD~1 ${{ github.sha }} | grep 'mindbox/pubspec.yaml' - echo ::set-output name=changed::$? + git diff-tree --no-commit-id --name-only -r HEAD~1 "$HEAD_SHA" | grep 'mindbox/pubspec.yaml' + rc=$? set -e + echo "changed=$rc" >> "$GITHUB_OUTPUT" - name: Extract package version if: steps.pubspec.outputs.changed == 0 run: | cd mindbox - echo "VERSION=$(awk '{if ($1 ~ /^version:/) print $2}' pubspec.yaml)" >> $GITHUB_ENV - - uses: sakebook/actions-flutter-pub-publisher@v1.3.1 + echo "VERSION=$(awk '{if ($1 ~ /^version:/) print $2}' pubspec.yaml)" >> "$GITHUB_ENV" + - uses: sakebook/actions-flutter-pub-publisher@ccd9fbba502ea7ef33ea2479e0cdac5a2a9766e1 # v1.4.1 if: steps.pubspec.outputs.changed == 0 with: package_directory: mindbox @@ -150,27 +166,25 @@ jobs: dry_run: false - name: Create Release if: steps.pubspec.outputs.changed == 0 - id: create_release - uses: actions/create-release@v1.1.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: mindbox-v${{ env.VERSION }} - release_name: mindbox v${{ env.VERSION }} - draft: false - prerelease: false + BRANCH: ${{ inputs.branch }} + run: ./.github/git-release-ci.sh "mindbox-v$VERSION" "mindbox v$VERSION" "$BRANCH" merge: needs: [plugin_publish] if: | - startsWith(github.head_ref, 'release') && + startsWith(github.head_ref, 'release/') && github.base_ref == 'master' runs-on: ubuntu-latest env: + # gh uses this PAT, not the workflow GITHUB_TOKEN — needed so the merge PR + # re-triggers branch-protection checks. Job-level `permissions:` only scope + # the workflow token, so they don't apply to these gh calls. GITHUB_TOKEN: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }} steps: - name: Checkout develop branch - uses: actions/checkout@v4 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: develop - name: Create Pull Request @@ -178,22 +192,4 @@ jobs: - name: Merge Pull Request run: | pr_number=$(gh pr list --base develop --head master --json number --jq '.[0].number') - gh pr merge $pr_number --merge --auto - - message-to-loop-if-success: - needs: [plugin_publish] - runs-on: ubuntu-latest - steps: - - name: Send message to LOOP - env: - LOOP_NOTIFICATION_WEBHOOK_URL: ${{ secrets.LOOP_NOTIFICATION_WEBHOOK_URL }} - VERSION: ${{ inputs.branch }} - run: | - MESSAGE=$(cat <<EOF - { - "text": "**🤖 Flutter release was successful. Version: ${VERSION}**" - } - EOF) - curl -X POST "$LOOP_NOTIFICATION_WEBHOOK_URL" \ - -H "Content-Type: application/json" \ - -d "$MESSAGE" + gh pr merge "$pr_number" --merge --auto diff --git a/.github/workflows/release-version-check.yml b/.github/workflows/release-version-check.yml index dbc93111..688a0c4b 100644 --- a/.github/workflows/release-version-check.yml +++ b/.github/workflows/release-version-check.yml @@ -7,32 +7,35 @@ on: - master - develop +permissions: + contents: read + jobs: check-rc-pattern: runs-on: ubuntu-latest - if: startsWith(github.head_ref, 'release') + if: startsWith(github.head_ref, 'release/') steps: - name: Check RC pattern + env: + HEAD_REF: ${{ github.head_ref }} run: | - if [[ "${{ github.head_ref }}" =~ release/[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then + if [[ "$HEAD_REF" =~ release/[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then echo "Branch name contains release/version-rc pattern. Merging is not allowed. Only stable release should be merge into master" exit 1 fi - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} check-master-version: needs: check-rc-pattern runs-on: ubuntu-latest - if: github.base_ref == 'master' && startsWith(github.head_ref, 'release') + if: github.base_ref == 'master' && startsWith(github.head_ref, 'release/') steps: - name: Checkout master branch - uses: actions/checkout@v4 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: master path: master - name: Checkout release branch - uses: actions/checkout@v4 + uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: ref: ${{ github.head_ref }} path: release @@ -40,10 +43,12 @@ jobs: run: | MASTER_VERSION=$(grep 'version:' master/mindbox/pubspec.yaml | awk '{print $2}') RELEASE_VERSION=$(grep 'version:' release/mindbox/pubspec.yaml | awk '{print $2}') - echo "MASTER_VERSION=$MASTER_VERSION" >> $GITHUB_ENV - echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV + { + echo "MASTER_VERSION=$MASTER_VERSION" + echo "RELEASE_VERSION=$RELEASE_VERSION" + } >> "$GITHUB_ENV" - name: Compare versions - uses: jackbilestech/semver-compare@1.0.4 + uses: jackbilestech/semver-compare@b6b063c569b77bea4a0ab627192cbdabf75de3f5 # 1.0.4 with: head: ${{ env.RELEASE_VERSION }} base: ${{ env.MASTER_VERSION }} diff --git a/README.md b/README.md index fb4556d5..7a5ec965 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,13 @@ flow don't need any code changes. [flutter-uiscene]: https://docs.flutter.dev/release/breaking-changes/uiscenedelegate +### iOS Swift Package Manager + +The plugin supports Swift Package Manager alongside CocoaPods. In SPM mode the +main app gets Mindbox automatically; notification extensions need a one-time +Xcode wiring step. See [SPM_MIGRATION.md](SPM_MIGRATION.md). CocoaPods users +need no changes. + ## Troubleshooting Refer to the [Example of integration(IOS)](https://github.com/mindbox-cloud/flutter-sdk/tree/develop/mindbox_ios/example) or [Example of integration(Android)](https://github.com/mindbox-cloud/flutter-sdk/tree/develop/mindbox_android/example) in case of any issues. diff --git a/SPM_MIGRATION.md b/SPM_MIGRATION.md new file mode 100644 index 00000000..ae156492 --- /dev/null +++ b/SPM_MIGRATION.md @@ -0,0 +1,44 @@ +# Mindbox Flutter SDK with Swift Package Manager + +The plugin ships SPM alongside CocoaPods. **Flutter 3.44+ enables SPM by +default** ([flutter#184495][spm-pr]); older releases need +`flutter config --enable-swift-package-manager` (SPM needs Flutter ≥ 3.29; the +per-project `config:` block in `pubspec.yaml` needs ≥ 3.35). The `Runner` gets +`Mindbox` automatically through the plugin — only two Mindbox-specific steps are +manual. + +> ⚠️ **Don't load Mindbox through both managers.** On 3.44+ SPM is on by default, +> so leaving `pod 'Mindbox'` in your `Podfile` links Mindbox twice → launch +> crash `Fatal error: ... Expected CDEvent but found CDEvent`. To stay on +> CocoaPods, opt out: `enable-swift-package-manager: false` (pubspec) or +> `flutter config --no-enable-swift-package-manager`. + +## 1. Notification extensions + +`Runner` project → **Package Dependencies** → **+** → +`https://github.com/mindbox-cloud/ios-sdk`, rule **Up to Next Major** from your +SDK version (e.g. `2.15.1` — a range, not "Exact"). Add the products: + +| Product | Add to target | +|---|---| +| `MindboxNotificationsService` | Notification **Service** Extension | +| `MindboxNotificationsContent` | Notification **Content** Extension | +| `Mindbox` | **None** — `Runner` already gets it via the plugin | + +## 2. Remove the Mindbox pods + +Delete `pod 'Mindbox'` (`Runner`) and `pod 'MindboxNotifications'` (each +extension) from the `Podfile`, then `flutter run`. If every plugin you use +supports SPM, drop CocoaPods entirely — delete the `Podfile` and +`pod deintegrate` (see [`example/flutter_example`][example]). + +## Notes + +- ObjC `MindboxFlutterAppDelegateObjc` is CocoaPods-only and deprecated; SPM + apps use the Swift `MindboxFlutterAppDelegate`. +- Project-level `ios-sdk` and the plugin's copy are the same package (same URL) + → one resolved version. Keep your range inclusive of the plugin's pin; don't + pin a different "Exact". + +[spm-pr]: https://github.com/flutter/flutter/pull/184495 +[example]: https://github.com/mindbox-cloud/flutter-sdk/tree/develop/example/flutter_example diff --git a/example/flutter_example/.gitignore b/example/flutter_example/.gitignore index 0506d31e..52c7fde8 100644 --- a/example/flutter_example/.gitignore +++ b/example/flutter_example/.gitignore @@ -33,6 +33,15 @@ migrate_working_dir/ .pub/ /build/ +# Local pub overrides (dev-only, wires example to local packages) +pubspec_overrides.yaml + +# Xcode/Flutter SwiftPM workspace dir. Ignore the per-machine scratch +# (configuration/) but COMMIT Package.resolved — this is an app, so its SPM +# lockfile is checked in for reproducible native-SDK resolution. +**/xcshareddata/swiftpm/* +!**/xcshareddata/swiftpm/Package.resolved + # Symbolication related app.*.symbols @@ -47,9 +56,5 @@ app.*.map.json /android/app/google-services.json /android/app/agconnect-services.json -# iOS -/ios/Pods/ -/ios/Podfile.lock - # FVM Version Cache .fvm/ \ No newline at end of file diff --git a/example/flutter_example/ios/Flutter/Debug.xcconfig b/example/flutter_example/ios/Flutter/Debug.xcconfig index ec97fc6f..592ceee8 100644 --- a/example/flutter_example/ios/Flutter/Debug.xcconfig +++ b/example/flutter_example/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/flutter_example/ios/Flutter/Release.xcconfig b/example/flutter_example/ios/Flutter/Release.xcconfig index c4855bfe..592ceee8 100644 --- a/example/flutter_example/ios/Flutter/Release.xcconfig +++ b/example/flutter_example/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/example/flutter_example/ios/MindboxNotificationServiceExtension/NotificationService.swift b/example/flutter_example/ios/MindboxNotificationServiceExtension/NotificationService.swift index 2735e8f9..4ed30e29 100644 --- a/example/flutter_example/ios/MindboxNotificationServiceExtension/NotificationService.swift +++ b/example/flutter_example/ios/MindboxNotificationServiceExtension/NotificationService.swift @@ -10,7 +10,7 @@ import MindboxNotifications class NotificationService: UNNotificationServiceExtension { - static let suiteName = "group.cloud.Mindbox.cloud.mindbox.flutterExample" + static let suiteName = "group.cloud.Mindbox.mindbox.Flutter.Example" lazy var mindboxService = MindboxNotificationService() override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { diff --git a/example/flutter_example/ios/Podfile b/example/flutter_example/ios/Podfile deleted file mode 100644 index 03702712..00000000 --- a/example/flutter_example/ios/Podfile +++ /dev/null @@ -1,72 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '13.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! -# add this pod if doesn't use MindboxFlutterAppDelegate - pod 'Mindbox' - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -# target 'RunnerTests' do -# inherit! :search_paths -# end - -end - - -target 'MindboxNotificationServiceExtension' do - use_frameworks! - pod 'MindboxNotifications' -end - -target 'MindboxNotificationContentExtension' do - use_frameworks! - pod 'MindboxNotifications' -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - - target.build_configurations.each do |config| - # You can remove unused permissions here - # for more information: https://github.com/BaseflowIT/flutter-permission-handler/blob/master/permission_handler/ios/Classes/PermissionHandlerEnums.h - # e.g. when you don't need camera permission, just add 'PERMISSION_CAMERA=0' - config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ - '$(inherited)', - - ## dart: PermissionGroup.notification - 'PERMISSION_NOTIFICATIONS=1', - ] - end - end -end - - - diff --git a/example/flutter_example/ios/Runner.xcodeproj/project.pbxproj b/example/flutter_example/ios/Runner.xcodeproj/project.pbxproj index 6a0d24c4..ec184c68 100644 --- a/example/flutter_example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/flutter_example/ios/Runner.xcodeproj/project.pbxproj @@ -7,15 +7,16 @@ objects = { /* Begin PBXBuildFile section */ - 0C6AACD917BD622C687DAB65 /* Pods_MindboxNotificationServiceExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4AC547651623FA3602973E87 /* Pods_MindboxNotificationServiceExtension.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 256F9F9FDB3D4DD436246818 /* MindboxNotificationsContent in Frameworks */ = {isa = PBXBuildFile; productRef = 0EA7F2BCC87452E0C5E83025 /* MindboxNotificationsContent */; }; 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 34D4D0D0DA45AF8FE0E2E2F5 /* MindboxNotificationsService in Frameworks */ = {isa = PBXBuildFile; productRef = 52D6F1212F70CD404ED943FA /* MindboxNotificationsService */; }; 3A04C4242C18A6EA008FB1C3 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A04C41C2C183779008FB1C3 /* Models.swift */; }; 3AFCC3DC2C6A0B4000F047AB /* AppDelegateUsedMindboxDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AFCC3DB2C6A0B4000F047AB /* AppDelegateUsedMindboxDelegate.swift */; }; 3AFCC3E02C6A0B4000F047AB /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AFCC3DF2C6A0B4000F047AB /* SceneDelegate.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 8B81E312DFA9C6FD4EDFB0F6 /* Pods_MindboxNotificationContentExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 201DB479D6282529C705748E /* Pods_MindboxNotificationContentExtension.framework */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -25,8 +26,6 @@ E1B395562BD985350090F3D2 /* UserNotificationsUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E1B395552BD985350090F3D2 /* UserNotificationsUI.framework */; }; E1B395592BD985350090F3D2 /* NotificationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1B395582BD985350090F3D2 /* NotificationViewController.swift */; }; E1B395602BD985350090F3D2 /* MindboxNotificationContentExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = E1B395522BD985350090F3D2 /* MindboxNotificationContentExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - FDACF0FD3A7597BBE1F0C9BD /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E84BF714550B188D12C0B51 /* Pods_Runner.framework */; }; - 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -81,25 +80,16 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; }; - 1E84BF714550B188D12C0B51 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 201DB479D6282529C705748E /* Pods_MindboxNotificationContentExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MindboxNotificationContentExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; }; 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 3A04C41C2C183779008FB1C3 /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = "<group>"; }; - 3A04C4202C18A4E0008FB1C3 /* Mindbox.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Mindbox.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3AFCC3DB2C6A0B4000F047AB /* AppDelegateUsedMindboxDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegateUsedMindboxDelegate.swift; sourceTree = "<group>"; }; 3AFCC3DF2C6A0B4000F047AB /* SceneDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; - 4AC547651623FA3602973E87 /* Pods_MindboxNotificationServiceExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MindboxNotificationServiceExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4C419D08BE184EB1CC17FC7F /* Pods-MindboxNotificationContentExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MindboxNotificationContentExtension.release.xcconfig"; path = "Target Support Files/Pods-MindboxNotificationContentExtension/Pods-MindboxNotificationContentExtension.release.xcconfig"; sourceTree = "<group>"; }; - 5ACBB9DBF94B5EB31B45DDF6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; }; - 629927C00EA2133BFB755C80 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; }; - 66FD4F7514C7280086A9D4DE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; }; - 6A77F4ECA7B3C83491917FD2 /* Pods-MindboxNotificationServiceExtension.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MindboxNotificationServiceExtension.profile.xcconfig"; path = "Target Support Files/Pods-MindboxNotificationServiceExtension/Pods-MindboxNotificationServiceExtension.profile.xcconfig"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; - 9308C6307F8A90C56C003FD0 /* Pods-MindboxNotificationContentExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MindboxNotificationContentExtension.debug.xcconfig"; path = "Target Support Files/Pods-MindboxNotificationContentExtension/Pods-MindboxNotificationContentExtension.debug.xcconfig"; sourceTree = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -107,8 +97,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - B2D711D6B1C18A53FB9ED866 /* Pods-MindboxNotificationServiceExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MindboxNotificationServiceExtension.release.xcconfig"; path = "Target Support Files/Pods-MindboxNotificationServiceExtension/Pods-MindboxNotificationServiceExtension.release.xcconfig"; sourceTree = "<group>"; }; - BE3FEFAD32E64B2C5F57EACB /* Pods-MindboxNotificationServiceExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MindboxNotificationServiceExtension.debug.xcconfig"; path = "Target Support Files/Pods-MindboxNotificationServiceExtension/Pods-MindboxNotificationServiceExtension.debug.xcconfig"; sourceTree = "<group>"; }; E19AAF922BD7F53B002D7897 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; }; E19AAFB92BD93664002D7897 /* MindboxNotificationServiceExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MindboxNotificationServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; E19AAFBB2BD93664002D7897 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; }; @@ -120,8 +108,6 @@ E1B395582BD985350090F3D2 /* NotificationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationViewController.swift; sourceTree = "<group>"; }; E1B3955D2BD985350090F3D2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; E1B395652BD985560090F3D2 /* MindboxNotificationContentExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MindboxNotificationContentExtension.entitlements; sourceTree = "<group>"; }; - EE5FB2A6B1C9CC1DF5D97EF8 /* Pods-MindboxNotificationContentExtension.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MindboxNotificationContentExtension.profile.xcconfig"; path = "Target Support Files/Pods-MindboxNotificationContentExtension/Pods-MindboxNotificationContentExtension.profile.xcconfig"; sourceTree = "<group>"; }; - 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -137,7 +123,6 @@ buildActionMask = 2147483647; files = ( 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, - FDACF0FD3A7597BBE1F0C9BD /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -145,7 +130,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 0C6AACD917BD622C687DAB65 /* Pods_MindboxNotificationServiceExtension.framework in Frameworks */, + 34D4D0D0DA45AF8FE0E2E2F5 /* MindboxNotificationsService in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -155,7 +140,7 @@ files = ( E1B395562BD985350090F3D2 /* UserNotificationsUI.framework in Frameworks */, E1B395542BD985350090F3D2 /* UserNotifications.framework in Frameworks */, - 8B81E312DFA9C6FD4EDFB0F6 /* Pods_MindboxNotificationContentExtension.framework in Frameworks */, + 256F9F9FDB3D4DD436246818 /* MindboxNotificationsContent in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -165,12 +150,8 @@ 151A896A3BE0584441AE7BE7 /* Frameworks */ = { isa = PBXGroup; children = ( - 3A04C4202C18A4E0008FB1C3 /* Mindbox.framework */, E1B395532BD985350090F3D2 /* UserNotifications.framework */, E1B395552BD985350090F3D2 /* UserNotificationsUI.framework */, - 201DB479D6282529C705748E /* Pods_MindboxNotificationContentExtension.framework */, - 4AC547651623FA3602973E87 /* Pods_MindboxNotificationServiceExtension.framework */, - 1E84BF714550B188D12C0B51 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = "<group>"; @@ -183,22 +164,6 @@ path = RunnerTests; sourceTree = "<group>"; }; - 3C5E0DD50222A55004474656 /* Pods */ = { - isa = PBXGroup; - children = ( - 9308C6307F8A90C56C003FD0 /* Pods-MindboxNotificationContentExtension.debug.xcconfig */, - 4C419D08BE184EB1CC17FC7F /* Pods-MindboxNotificationContentExtension.release.xcconfig */, - EE5FB2A6B1C9CC1DF5D97EF8 /* Pods-MindboxNotificationContentExtension.profile.xcconfig */, - BE3FEFAD32E64B2C5F57EACB /* Pods-MindboxNotificationServiceExtension.debug.xcconfig */, - B2D711D6B1C18A53FB9ED866 /* Pods-MindboxNotificationServiceExtension.release.xcconfig */, - 6A77F4ECA7B3C83491917FD2 /* Pods-MindboxNotificationServiceExtension.profile.xcconfig */, - 629927C00EA2133BFB755C80 /* Pods-Runner.debug.xcconfig */, - 5ACBB9DBF94B5EB31B45DDF6 /* Pods-Runner.release.xcconfig */, - 66FD4F7514C7280086A9D4DE /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = "<group>"; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -220,7 +185,6 @@ E1B395572BD985350090F3D2 /* MindboxNotificationContentExtension */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, - 3C5E0DD50222A55004474656 /* Pods */, 151A896A3BE0584441AE7BE7 /* Frameworks */, ); sourceTree = "<group>"; @@ -297,13 +261,9 @@ productType = "com.apple.product-type.bundle.unit-test"; }; 97C146ED1CF9000F007C117D /* Runner */ = { - packageProductDependencies = ( - 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, - ); isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 7A49514126B217A17B87F98E /* [CP] Check Pods Manifest.lock */, E19AAF9F2BD92C73002D7897 /* Embed Foundation Extensions */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, @@ -311,8 +271,6 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - A2750317145405479AAE1033 /* [CP] Embed Pods Frameworks */, - C5E781EA6DBDA6504FEE2E88 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -321,6 +279,9 @@ E1B3955F2BD985350090F3D2 /* PBXTargetDependency */, ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -329,7 +290,6 @@ isa = PBXNativeTarget; buildConfigurationList = E19AAFC12BD93664002D7897 /* Build configuration list for PBXNativeTarget "MindboxNotificationServiceExtension" */; buildPhases = ( - 9207252F6686FE6DD1EBF525 /* [CP] Check Pods Manifest.lock */, E19AAFB52BD93664002D7897 /* Sources */, E19AAFB62BD93664002D7897 /* Frameworks */, E19AAFB72BD93664002D7897 /* Resources */, @@ -339,6 +299,9 @@ dependencies = ( ); name = MindboxNotificationServiceExtension; + packageProductDependencies = ( + 52D6F1212F70CD404ED943FA /* MindboxNotificationsService */, + ); productName = MindboxNotificationServiceExtension; productReference = E19AAFB92BD93664002D7897 /* MindboxNotificationServiceExtension.appex */; productType = "com.apple.product-type.app-extension"; @@ -347,7 +310,6 @@ isa = PBXNativeTarget; buildConfigurationList = E1B395642BD985360090F3D2 /* Build configuration list for PBXNativeTarget "MindboxNotificationContentExtension" */; buildPhases = ( - B5F7D46B07A2E305AB82C8EA /* [CP] Check Pods Manifest.lock */, E1B3954E2BD985350090F3D2 /* Sources */, E1B3954F2BD985350090F3D2 /* Frameworks */, E1B395502BD985350090F3D2 /* Resources */, @@ -357,6 +319,9 @@ dependencies = ( ); name = MindboxNotificationContentExtension; + packageProductDependencies = ( + 0EA7F2BCC87452E0C5E83025 /* MindboxNotificationsContent */, + ); productName = MindboxNotificationContentExtension; productReference = E1B395522BD985350090F3D2 /* MindboxNotificationContentExtension.appex */; productType = "com.apple.product-type.app-extension"; @@ -365,9 +330,6 @@ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { - packageReferences = ( - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, - ); isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; @@ -400,6 +362,10 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + C4A124B3CCD84B28F602BCFA /* XCRemoteSwiftPackageReference "ios-sdk" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -464,50 +430,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 7A49514126B217A17B87F98E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 9207252F6686FE6DD1EBF525 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-MindboxNotificationServiceExtension-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; alwaysOutOfDate = 1; @@ -523,62 +445,6 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n"; }; - A2750317145405479AAE1033 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - B5F7D46B07A2E305AB82C8EA /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-MindboxNotificationContentExtension-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - C5E781EA6DBDA6504FEE2E88 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -682,6 +548,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -704,6 +571,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SUPPORTED_PLATFORMS = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -714,7 +582,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; @@ -806,6 +673,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -835,6 +703,7 @@ MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -863,6 +732,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -885,6 +755,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 15.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SUPPORTED_PLATFORMS = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -897,7 +768,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; @@ -923,7 +793,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; @@ -946,7 +815,6 @@ }; E19AAFC22BD93664002D7897 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BE3FEFAD32E64B2C5F57EACB /* Pods-MindboxNotificationServiceExtension.debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -961,19 +829,8 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 622436AMYX; ENABLE_USER_SCRIPT_SANDBOXING = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxLogger\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxNotifications\"", - ); GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxLogger/MindboxLogger.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxNotifications/MindboxNotifications.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxLogger/Mindbox.framework/Headers\"", - ); INFOPLIST_FILE = MindboxNotificationServiceExtension/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = MindboxNotificationServiceExtension; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -984,7 +841,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = mindbox.Flutter.Example.ServiceExtension; @@ -1002,7 +859,6 @@ }; E19AAFC32BD93664002D7897 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B2D711D6B1C18A53FB9ED866 /* Pods-MindboxNotificationServiceExtension.release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -1017,20 +873,8 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 622436AMYX; ENABLE_USER_SCRIPT_SANDBOXING = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxLogger\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxNotifications\"", - ); GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; - HEADER_SEARCH_PATHS = ( - "$(inherited)", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxLogger/MindboxLogger.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxNotifications/MindboxNotifications.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/Mindbox/Mindbox.framework/Headers\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxLogger/Mindbox.framework/Headers\"", - ); INFOPLIST_FILE = MindboxNotificationServiceExtension/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = MindboxNotificationServiceExtension; INFOPLIST_KEY_NSHumanReadableCopyright = ""; @@ -1041,7 +885,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = mindbox.Flutter.Example.ServiceExtension; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1056,7 +900,6 @@ }; E19AAFC42BD93664002D7897 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6A77F4ECA7B3C83491917FD2 /* Pods-MindboxNotificationServiceExtension.profile.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -1071,11 +914,6 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 622436AMYX; ENABLE_USER_SCRIPT_SANDBOXING = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxLogger\"", - "\"${PODS_CONFIGURATION_BUILD_DIR}/MindboxNotifications\"", - ); GCC_C_LANGUAGE_STANDARD = gnu17; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = MindboxNotificationServiceExtension/Info.plist; @@ -1088,7 +926,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = mindbox.Flutter.Example.ServiceExtension; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1103,7 +941,6 @@ }; E1B395612BD985360090F3D2 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9308C6307F8A90C56C003FD0 /* Pods-MindboxNotificationContentExtension.debug.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -1129,7 +966,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = mindbox.Flutter.Example.ContentExtension; @@ -1146,7 +983,6 @@ }; E1B395622BD985360090F3D2 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4C419D08BE184EB1CC17FC7F /* Pods-MindboxNotificationContentExtension.release.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -1172,7 +1008,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = mindbox.Flutter.Example.ContentExtension; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1186,7 +1022,6 @@ }; E1B395632BD985360090F3D2 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = EE5FB2A6B1C9CC1DF5D97EF8 /* Pods-MindboxNotificationContentExtension.profile.xcconfig */; buildSettings = { CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; @@ -1212,7 +1047,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = mindbox.Flutter.Example.ContentExtension; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1278,13 +1113,36 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + /* Begin XCLocalSwiftPackageReference section */ 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { isa = XCLocalSwiftPackageReference; relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; }; /* End XCLocalSwiftPackageReference section */ + +/* Begin XCRemoteSwiftPackageReference section */ + C4A124B3CCD84B28F602BCFA /* XCRemoteSwiftPackageReference "ios-sdk" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/mindbox-cloud/ios-sdk"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 2.15.1; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + /* Begin XCSwiftPackageProductDependency section */ + 0EA7F2BCC87452E0C5E83025 /* MindboxNotificationsContent */ = { + isa = XCSwiftPackageProductDependency; + package = C4A124B3CCD84B28F602BCFA /* XCRemoteSwiftPackageReference "ios-sdk" */; + productName = MindboxNotificationsContent; + }; + 52D6F1212F70CD404ED943FA /* MindboxNotificationsService */ = { + isa = XCSwiftPackageProductDependency; + package = C4A124B3CCD84B28F602BCFA /* XCRemoteSwiftPackageReference "ios-sdk" */; + productName = MindboxNotificationsService; + }; 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { isa = XCSwiftPackageProductDependency; productName = FlutterGeneratedPluginSwiftPackage; diff --git a/example/flutter_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/flutter_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..2d69bca4 --- /dev/null +++ b/example/flutter_example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mindbox-cloud/ios-sdk", + "state" : { + "revision" : "062e54b831e14c70ab2a7e7f3049626c776e47c7", + "version" : "2.15.1" + } + } + ], + "version" : 2 +} diff --git a/example/flutter_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/flutter_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 25000c40..988fbfa5 100644 --- a/example/flutter_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/flutter_example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme LastUpgradeVersion = "1510" - version = "1.3"> + version = "1.7"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> diff --git a/example/flutter_example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/flutter_example/ios/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc14..1d526a16 100644 --- a/example/flutter_example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/example/flutter_example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ <FileRef location = "group:Runner.xcodeproj"> </FileRef> - <FileRef - location = "group:Pods/Pods.xcodeproj"> - </FileRef> </Workspace> diff --git a/example/flutter_example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/flutter_example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..2d69bca4 --- /dev/null +++ b/example/flutter_example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,14 @@ +{ + "pins" : [ + { + "identity" : "ios-sdk", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mindbox-cloud/ios-sdk", + "state" : { + "revision" : "062e54b831e14c70ab2a7e7f3049626c776e47c7", + "version" : "2.15.1" + } + } + ], + "version" : 2 +} diff --git a/example/flutter_example/lib/view/managers/push_item_manager.dart b/example/flutter_example/lib/view/managers/push_item_manager.dart index 01325317..a4ac96b2 100644 --- a/example/flutter_example/lib/view/managers/push_item_manager.dart +++ b/example/flutter_example/lib/view/managers/push_item_manager.dart @@ -47,7 +47,7 @@ class ItemsManager { } } static const int removeStartIndex = 3; - static const appGroupID = 'group.cloud.Mindbox.cloud.mindbox.flutterExample'; + static const appGroupID = 'group.cloud.Mindbox.mindbox.Flutter.Example'; ValueNotifier<List<MindboxRemoteMessage>> itemsNotifier; diff --git a/example/flutter_example/lib/view_model/view_model.dart b/example/flutter_example/lib/view_model/view_model.dart index 980db725..2407a028 100644 --- a/example/flutter_example/lib/view_model/view_model.dart +++ b/example/flutter_example/lib/view_model/view_model.dart @@ -3,7 +3,7 @@ import 'package:permission_handler/permission_handler.dart'; class ViewModel { //https://developers.mindbox.ru/docs/%D0%BC%D0%B5%D1%82%D0%BE%D0%B4%D1%8B-flutter-sdk - static syncOperation() { + static void syncOperation() { Mindbox.instance.executeSyncOperation( operationSystemName: 'APIMethodForReleaseExampleIos', operationBody: { @@ -18,7 +18,7 @@ class ViewModel { ); } - static asyncOperation() { + static void asyncOperation() { Mindbox.instance.executeAsyncOperation( operationSystemName: "APIMethodForReleaseExampleIos", operationBody: { @@ -31,34 +31,34 @@ class ViewModel { } //used for send action "notification center was opened" - static asyncOperationNCOpen() { + static void asyncOperationNCOpen() { Mindbox.instance.executeAsyncOperation( operationSystemName: "mobileapp.NCOpen", operationBody: {}); } //used for send action "click on push from notification center" - static asyncOperationNCPushOpen(String pushName, String pushDate) { + static void asyncOperationNCPushOpen(String pushName, String pushDate) { Mindbox.instance.executeAsyncOperation( operationSystemName: "mobileapp.NCPushOpen", operationBody: getPushOpenOperationBody(pushName, pushDate)); } - static getSDKVersion(Function complition) { + static void getSDKVersion(void Function(String) completion) { Mindbox.instance.nativeSdkVersion.then((value) { - complition(value); + completion(value); }); } - static getToken(Function complition) { + static void getToken(void Function(String) completion) { Mindbox.instance.getToken((value) { - complition(value); + completion(value); }); } - static getDeviceUUID(Function complition) { + static void getDeviceUUID(void Function(String) completion) { Mindbox.instance.getDeviceUUID((value) { print(value); - complition(value); + completion(value); }); } @@ -72,7 +72,7 @@ class ViewModel { } //https://developers.mindbox.ru/docs/in-app - static chooseInAppCallback(ChooseInappCallback chooseInappCallback) { + static void chooseInAppCallback(ChooseInappCallback chooseInappCallback) { switch (chooseInappCallback) { case ChooseInappCallback.defaultInAppCallback: break; diff --git a/example/flutter_example/pubspec.lock b/example/flutter_example/pubspec.lock index afd9d525..67e956fc 100644 --- a/example/flutter_example/pubspec.lock +++ b/example/flutter_example/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: async - sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63 + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 url: "https://pub.dev" source: hosted - version: "2.12.0" + version: "2.13.1" boolean_selector: dependency: transitive description: @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" clock: dependency: transitive description: @@ -45,26 +45,26 @@ packages: dependency: "direct main" description: name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" url: "https://pub.dev" source: hosted - version: "1.0.8" + version: "1.0.9" fake_async: dependency: transitive description: name: fake_async - sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc" + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.3" ffi: dependency: transitive description: name: ffi - sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" file: dependency: transitive description: @@ -82,10 +82,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "6.0.0" flutter_test: dependency: "direct dev" description: flutter @@ -100,90 +100,86 @@ packages: dependency: transitive description: name: leak_tracker - sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" url: "https://pub.dev" source: hosted - version: "10.0.8" + version: "11.0.2" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.10" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.0.2" lints: dependency: transitive description: name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "6.1.0" matcher: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" meta: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.18.0" mindbox: dependency: "direct main" description: - name: mindbox - sha256: "65c61362fc1fe3580944656d9444692e2d935fd53a2cb23e25436eb8f895081a" - url: "https://pub.dev" - source: hosted - version: "2.11.0" + path: "../../mindbox" + relative: true + source: path + version: "2.15.2" mindbox_android: - dependency: transitive + dependency: "direct overridden" description: - name: mindbox_android - sha256: "1a9c2e6c7635c7a8fb852ee594bce27767ab5358299eb7b9f5a1def03cd24a59" - url: "https://pub.dev" - source: hosted - version: "2.11.0" + path: "../../mindbox_android" + relative: true + source: path + version: "2.15.2" mindbox_ios: - dependency: transitive + dependency: "direct overridden" description: - name: mindbox_ios - sha256: "124f66019abf979ecde73a57261925bfa8745d31fe7ab0177979dfe872723534" - url: "https://pub.dev" - source: hosted - version: "2.11.0" + path: "../../mindbox_ios" + relative: true + source: path + version: "2.15.2" mindbox_platform_interface: - dependency: transitive + dependency: "direct overridden" description: - name: mindbox_platform_interface - sha256: "48ddddca92e605f4fa75dbee1671cabb5f7b61e8506fb0ffe337ff942184c6e1" - url: "https://pub.dev" - source: hosted - version: "2.11.0" + path: "../../mindbox_platform_interface" + relative: true + source: path + version: "2.15.2" path: dependency: transitive description: @@ -220,26 +216,26 @@ packages: dependency: "direct main" description: name: permission_handler - sha256: "59adad729136f01ea9e35a48f5d1395e25cba6cea552249ddbe9cf950f5d7849" + sha256: fe54465bcc62a4564c6e4db337bbaded6c0c0fa6e10487414436d163114784f6 url: "https://pub.dev" source: hosted - version: "11.4.0" + version: "12.0.3" permission_handler_android: dependency: transitive description: name: permission_handler_android - sha256: d3971dcdd76182a0c198c096b5db2f0884b0d4196723d21a866fc4cdea057ebc + sha256: "1e3bc410ca1bf84662104b100eb126e066cb55791b7451307f9708d4007350e6" url: "https://pub.dev" source: hosted - version: "12.1.0" + version: "13.0.1" permission_handler_apple: dependency: transitive description: name: permission_handler_apple - sha256: f84a188e79a35c687c132a0a0556c254747a08561e99ab933f12f6ca71ef3c98 + sha256: e20daf680eef1ca62ffe8c8c526b778cc386d50137c77ac71c8ec9c88c13fb9d url: "https://pub.dev" source: hosted - version: "9.4.6" + version: "9.4.9" permission_handler_html: dependency: transitive description: @@ -284,34 +280,34 @@ packages: dependency: "direct main" description: name: shared_preference_app_group - sha256: "478ad76d03397a930a964d3b0e64f9d4fca816c83c1c059542032eafeb29b607" + sha256: "6e8aa2b22e05e6317340a5225899f36b23d09ea47efc95da615919492fff8512" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "2.1.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: "846849e3e9b68f3ef4b60c60cf4b3e02e9321bc7f4d8c4692cf87ffa82fc8a3a" + sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.5" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "3ec7210872c4ba945e3244982918e502fa2bfb5230dff6832459ca0e1879b7ad" + sha256: e8d4762b1e2e8578fc4d0fd548cebf24afd24f49719c08974df92834565e2c53 url: "https://pub.dev" source: hosted - version: "2.4.8" + version: "2.4.23" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" + sha256: "4e7eaffc2b17ba398759f1151415869a34771ba11ebbccd1b0145472a619a64f" url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "2.5.6" shared_preferences_linux: dependency: transitive description: @@ -324,10 +320,10 @@ packages: dependency: transitive description: name: shared_preferences_platform_interface - sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" + sha256: "649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" shared_preferences_web: dependency: transitive description: @@ -353,10 +349,10 @@ packages: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.2" stack_trace: dependency: transitive description: @@ -393,50 +389,50 @@ packages: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.11" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" + sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 url: "https://pub.dev" source: hosted - version: "6.3.1" + version: "6.3.2" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "1d0eae19bd7606ef60fe69ef3b312a437a16549476c42321d5dc1506c9ca3bf4" + sha256: "17bc677f0b301615530dd1d67e0a9828cafa2d0b6b6eae4cd3679b7eac4a273c" url: "https://pub.dev" source: hosted - version: "6.3.15" + version: "6.3.30" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "16a513b6c12bb419304e72ea0ae2ab4fed569920d1c7cb850263fe3acc824626" + sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0" url: "https://pub.dev" source: hosted - version: "6.3.2" + version: "6.4.1" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.2.2" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" + sha256: "368adf46f71ad3c21b8f06614adb38346f193f3a59ba8fe9a2fd74133070ba18" url: "https://pub.dev" source: hosted - version: "3.2.2" + version: "3.2.5" url_launcher_platform_interface: dependency: transitive description: @@ -449,34 +445,34 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "3ba963161bd0fe395917ba881d320b9c4f6dd3c4a233da62ab18a5025c85f1e9" + sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f" url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.5" vector_math: dependency: transitive description: name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.0" vm_service: dependency: transitive description: name: vm_service - sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14" + sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360" url: "https://pub.dev" source: hosted - version: "14.3.1" + version: "15.2.0" web: dependency: transitive description: @@ -494,5 +490,5 @@ packages: source: hosted version: "1.1.0" sdks: - dart: ">=3.7.0 <4.0.0" - flutter: ">=3.27.0" + dart: ">=3.11.0 <4.0.0" + flutter: ">=3.41.0" diff --git a/example/flutter_example/pubspec.yaml b/example/flutter_example/pubspec.yaml index 5283f645..5b3c73d7 100644 --- a/example/flutter_example/pubspec.yaml +++ b/example/flutter_example/pubspec.yaml @@ -17,15 +17,21 @@ dependencies: sdk: flutter cupertino_icons: ^1.0.6 mindbox: ^2.13.0 #https://developers.mindbox.ru/docs/add-sdk-flutter - permission_handler: ^11.3.1 + permission_handler: ^12.0.3 url_launcher: ^6.2.6 shared_preferences: ^2.5.2 - shared_preference_app_group: ^1.1.1 + shared_preference_app_group: ^2.1.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^3.0.0 + flutter_lints: ^6.0.0 flutter: uses-material-design: true + # Per-project override of the global `flutter config` flag. Forced to true + # so the example always exercises the SPM path the plugin now ships, + # regardless of the consumer's global flutter config. Flip to false locally + # to test the CocoaPods-only path. + config: + enable-swift-package-manager: true diff --git a/git-release-branch.sh b/git-release-branch.sh index 33df6501..98aaf591 100755 --- a/git-release-branch.sh +++ b/git-release-branch.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash +set -euo pipefail # Check the current Git branch current_branch=$(git symbolic-ref --short HEAD) @@ -9,7 +10,7 @@ if [[ $current_branch != "develop" && ! $current_branch =~ ^release/[0-9]+\.[0-9 fi # Check if the parameter is provided -read -p "Flutter SDK release version: " version +read -r -p "Flutter SDK release version: " version # Check if the version number matches the semver format if ! [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc)?$ ]]; then @@ -19,8 +20,8 @@ fi # Create a branch with the version name branch_name="release/$version" -git branch $branch_name -git checkout $branch_name +git branch "$branch_name" +git checkout "$branch_name" echo "Branch $branch_name has been created." @@ -51,7 +52,7 @@ git add $ios_yaml git add $android_yaml git add $common_yaml -read -p "Android SDK version: " android_sdk_version +read -r -p "Android SDK version: " android_sdk_version # Check if the version number matches the semver format if ! [[ $android_sdk_version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc)?$ ]]; then @@ -59,7 +60,7 @@ if ! [[ $android_sdk_version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc)?$ ]]; then exit 1 fi -read -p "iOS SDK version: " ios_sdk_version +read -r -p "iOS SDK version: " ios_sdk_version # Check if the version number matches the semver format if ! [[ $ios_sdk_version =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc)?$ ]]; then @@ -72,14 +73,31 @@ sed -i '' "s/ api 'cloud.mindbox:mobile-sdk:.*/ api 'cloud.mindbox:mobile- echo "Bump $android_gradle to $android_sdk_version" +# Fail loudly if a version substitution didn't land (e.g. the line format +# changed and sed silently matched nothing, leaving a stale pin). +assert_pin() { # <file> <grep-ERE> + grep -qE "$2" "$1" || { echo "ERROR: pattern /$2/ not found in $1 — version substitution failed"; exit 1; } +} + ios_podspec="mindbox_ios/ios/mindbox_ios.podspec" sed -i '' "s/ s.version = .*/ s.version = '$ios_sdk_version'/" $ios_podspec sed -i '' "s/ s.dependency 'Mindbox', .*/ s.dependency 'Mindbox', '$ios_sdk_version'/" $ios_podspec sed -i '' "s/ s.dependency 'MindboxNotifications', .*/ s.dependency 'MindboxNotifications', '$ios_sdk_version'/" $ios_podspec +assert_pin "$ios_podspec" "s\.dependency 'Mindbox', *'$ios_sdk_version'" +assert_pin "$ios_podspec" "s\.dependency 'MindboxNotifications', *'$ios_sdk_version'" echo "Bump $ios_podspec to $ios_sdk_version" +# Same pin in the SPM manifest. Address (/mindbox-cloud\/ios-sdk/) limits the +# substitution to the line that references the native SDK package, so unrelated +# `exact:` pins stay untouched if more dependencies are added later. +ios_package_swift="mindbox_ios/ios/mindbox_ios/Package.swift" +sed -i '' "/mindbox-cloud\/ios-sdk/ s/exact: \"[^\"]*\"/exact: \"$ios_sdk_version\"/" $ios_package_swift +assert_pin "$ios_package_swift" "exact: *\"$ios_sdk_version\"" + +echo "Bump $ios_package_swift to $ios_sdk_version" + mindbox_ios_changelog="mindbox_ios/CHANGELOG.md" mindbox_android_changelog="mindbox_android/CHANGELOG.md" mindbox_changelog="mindbox/CHANGELOG.md" @@ -95,6 +113,7 @@ echo -e "${changelog}${changelog_android}\n${changelog_ios}\n\n$(cat $mindbox_pl echo -e "${changelog}${changelog_android}\n${changelog_ios}\n\n$(cat $mindbox_changelog)" > $mindbox_changelog git add $ios_podspec +git add $ios_package_swift git add $android_gradle git add $mindbox_ios_changelog git add $mindbox_android_changelog diff --git a/mindbox/CHANGELOG.md b/mindbox/CHANGELOG.md index ff78d005..aa765cfd 100644 --- a/mindbox/CHANGELOG.md +++ b/mindbox/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.15.3 + +* Upgrade native Android SDK dependency to v2.15.3. +* Upgrade native iOS SDK dependency to v2.15.2. + ## 2.15.2 * Upgrade native Android SDK dependency to v2.15.2. diff --git a/mindbox/pubspec.yaml b/mindbox/pubspec.yaml index 19752611..af001f69 100644 --- a/mindbox/pubspec.yaml +++ b/mindbox/pubspec.yaml @@ -1,12 +1,12 @@ name: mindbox description: Flutter Mindbox SDK. Plugin wrapper over of Mindbox iOS/Android SDK. -version: 2.15.2 +version: 2.15.3 homepage: https://mindbox.cloud/ repository: https://github.com/mindbox-cloud/flutter-sdk/tree/master/mindbox documentation: https://developers.mindbox.ru/docs/flutter-sdk-integration environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" flutter: ">=2.0.0" flutter: @@ -20,9 +20,9 @@ flutter: dependencies: flutter: sdk: flutter - mindbox_android: ^2.15.2 - mindbox_ios: ^2.15.2 - mindbox_platform_interface: ^2.15.2 + mindbox_android: ^2.15.3 + mindbox_ios: ^2.15.3 + mindbox_platform_interface: ^2.15.3 dev_dependencies: flutter_test: diff --git a/mindbox_android/CHANGELOG.md b/mindbox_android/CHANGELOG.md index 4a7e745f..2ecd4291 100644 --- a/mindbox_android/CHANGELOG.md +++ b/mindbox_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.15.3 + +* Upgrade native Android SDK dependency to v2.15.3. + ## 2.15.2 * Upgrade native Android SDK dependency to v2.15.2. diff --git a/mindbox_android/android/build.gradle b/mindbox_android/android/build.gradle index 6a56dabf..9115aef8 100644 --- a/mindbox_android/android/build.gradle +++ b/mindbox_android/android/build.gradle @@ -50,5 +50,5 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - api 'cloud.mindbox:mobile-sdk:2.15.2' + api 'cloud.mindbox:mobile-sdk:2.15.3' } diff --git a/mindbox_android/pubspec.yaml b/mindbox_android/pubspec.yaml index 4632a0b2..79be63a8 100644 --- a/mindbox_android/pubspec.yaml +++ b/mindbox_android/pubspec.yaml @@ -1,11 +1,11 @@ name: mindbox_android description: The implementation of 'mindbox' plugin for the Android platform. -version: 2.15.2 +version: 2.15.3 homepage: https://mindbox.cloud/ repository: https://github.com/mindbox-cloud/flutter-sdk/tree/master/mindbox_android environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" flutter: ">=2.0.0" flutter: @@ -19,7 +19,7 @@ flutter: dependencies: flutter: sdk: flutter - mindbox_platform_interface: ^2.15.2 + mindbox_platform_interface: ^2.15.3 dev_dependencies: flutter_test: diff --git a/mindbox_ios/.gitignore b/mindbox_ios/.gitignore index 845d9c50..20e86f18 100644 --- a/mindbox_ios/.gitignore +++ b/mindbox_ios/.gitignore @@ -7,3 +7,8 @@ pubspec.lock .pub/ mindbox_ios.iml build/ + +# Swift Package Manager +.build/ +.swiftpm/ +Package.resolved diff --git a/mindbox_ios/CHANGELOG.md b/mindbox_ios/CHANGELOG.md index 4c207264..1183784f 100644 --- a/mindbox_ios/CHANGELOG.md +++ b/mindbox_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.15.3 + +* Upgrade native iOS SDK dependency to v2.15.2. + ## 2.15.2 * Upgrade native iOS SDK dependency to v2.15.1. diff --git a/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.h b/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.h index ed46c98e..ad35e6d8 100644 --- a/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.h +++ b/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.h @@ -1,5 +1,6 @@ #import <Flutter/Flutter.h> +DEPRECATED_MSG_ATTRIBUTE("Use Swift MindboxFlutterAppDelegate instead. ObjC version will be removed in mindbox_ios 3.0.0.") @interface MindboxFlutterAppDelegateObjc : FlutterAppDelegate @end diff --git a/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.m b/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.m index b4b7a446..5c5dbbe4 100644 --- a/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.m +++ b/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.m @@ -1,5 +1,4 @@ #import <MindboxFlutterAppDelegate.h> -#import <MindboxIosPlugin.h> @import Mindbox; diff --git a/mindbox_ios/ios/Classes/MindboxIosPlugin.h b/mindbox_ios/ios/Classes/MindboxIosPlugin.h deleted file mode 100644 index 2f84f1b8..00000000 --- a/mindbox_ios/ios/Classes/MindboxIosPlugin.h +++ /dev/null @@ -1,7 +0,0 @@ -#import <Flutter/Flutter.h> - -@interface MindboxIosPlugin : NSObject<FlutterPlugin> - -+ (void)pushClicked:(UNNotificationResponse*)response __attribute__((deprecated)); - -@end diff --git a/mindbox_ios/ios/Classes/MindboxIosPlugin.m b/mindbox_ios/ios/Classes/MindboxIosPlugin.m deleted file mode 100644 index 50841ea0..00000000 --- a/mindbox_ios/ios/Classes/MindboxIosPlugin.m +++ /dev/null @@ -1,19 +0,0 @@ -#import "MindboxIosPlugin.h" -#if __has_include(<mindbox_ios/mindbox_ios-Swift.h>) -#import <mindbox_ios/mindbox_ios-Swift.h> -#else -// Support project import fallback if the generated compatibility header -// is not copied when this plugin is created as a library. -// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 -#import "mindbox_ios-Swift.h" -#endif - -@implementation MindboxIosPlugin -+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar { - [SwiftMindboxIosPlugin registerWithRegistrar:registrar]; -} - -+ (void)pushClicked:(UNNotificationResponse *)response __attribute__((deprecated(""))) { -} - -@end diff --git a/mindbox_ios/ios/mindbox_ios.podspec b/mindbox_ios/ios/mindbox_ios.podspec index 1b40a943..0edb2b62 100644 --- a/mindbox_ios/ios/mindbox_ios.podspec +++ b/mindbox_ios/ios/mindbox_ios.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'mindbox_ios' - s.version = '2.15.1' + s.version = '2.15.2' s.summary = 'Mindbox Flutter SDK' s.description = <<-DESC The implementation of 'mindbox' plugin for the iOS platform @@ -13,10 +13,10 @@ The implementation of 'mindbox' plugin for the iOS platform s.license = { :file => '../LICENSE' } s.author = { 'Mindbox' => 'it@mindbox.ru' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'mindbox_ios/Sources/mindbox_ios/**/*.swift', 'Classes/MindboxFlutterAppDelegate.{h,m}' s.dependency 'Flutter' - s.dependency 'Mindbox', '2.15.1' - s.dependency 'MindboxNotifications', '2.15.1' + s.dependency 'Mindbox', '2.15.2' + s.dependency 'MindboxNotifications', '2.15.2' s.platform = :ios, '12.0' # Flutter.framework does not contain a i386 slice. diff --git a/mindbox_ios/ios/mindbox_ios/Package.swift b/mindbox_ios/ios/mindbox_ios/Package.swift new file mode 100644 index 00000000..806d88e5 --- /dev/null +++ b/mindbox_ios/ios/mindbox_ios/Package.swift @@ -0,0 +1,23 @@ +// swift-tools-version: 5.9 +import PackageDescription + +let package = Package( + name: "mindbox_ios", + platforms: [ + .iOS(.v12) + ], + products: [ + .library(name: "mindbox-ios", targets: ["mindbox_ios"]) + ], + dependencies: [ + .package(url: "https://github.com/mindbox-cloud/ios-sdk", exact: "2.15.2"), + ], + targets: [ + .target( + name: "mindbox_ios", + dependencies: [ + .product(name: "Mindbox", package: "ios-sdk"), + ] + ) + ] +) diff --git a/mindbox_ios/ios/Classes/Constants.swift b/mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/Constants.swift similarity index 100% rename from mindbox_ios/ios/Classes/Constants.swift rename to mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/Constants.swift diff --git a/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.swift b/mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/MindboxFlutterAppDelegate.swift similarity index 99% rename from mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.swift rename to mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/MindboxFlutterAppDelegate.swift index 253d07d8..822039df 100644 --- a/mindbox_ios/ios/Classes/MindboxFlutterAppDelegate.swift +++ b/mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/MindboxFlutterAppDelegate.swift @@ -1,7 +1,6 @@ import UIKit import Flutter import Mindbox -import MindboxNotifications open class MindboxFlutterAppDelegate: FlutterAppDelegate { diff --git a/mindbox_ios/ios/Classes/SwiftMindboxIosPlugin.swift b/mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/MindboxIosPlugin.swift similarity index 90% rename from mindbox_ios/ios/Classes/SwiftMindboxIosPlugin.swift rename to mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/MindboxIosPlugin.swift index 5d07fa98..8c298776 100644 --- a/mindbox_ios/ios/Classes/SwiftMindboxIosPlugin.swift +++ b/mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/MindboxIosPlugin.swift @@ -1,56 +1,55 @@ import Flutter import UIKit import Mindbox -import MindboxLogger -public class SwiftMindboxIosPlugin: NSObject, FlutterPlugin { +public class MindboxIosPlugin: NSObject, FlutterPlugin { private final var channel: FlutterMethodChannel - + private final let compositeDelegate = CompositeClass() - + public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: Constants.pluginChannelName, binaryMessenger: registrar.messenger()) - let instance = SwiftMindboxIosPlugin(channel: channel) + let instance = MindboxIosPlugin(channel: channel) registrar.addMethodCallDelegate(instance, channel: channel) registrar.addApplicationDelegate(instance) - + } - + init(channel: FlutterMethodChannel) { self.channel = channel super.init() } - + @available(*, deprecated) @objc public static func pushClicked(response: UNNotificationResponse){ } - - + + public func pushClicked(response: UNNotificationResponse){ let action = response.actionIdentifier as NSString let request = response.notification.request let userInfo = request.content.userInfo - + var link: NSString? var payload: NSString? - + if let url = userInfo["clickUrl"] as? NSString { link = url } - + if let payloadData = userInfo["payload"] as? NSString { payload = payloadData } - + if(link == nil){ let aps = userInfo["aps"] as? NSDictionary link = aps?["clickUrl"] as? NSString payload = aps?["payload"] as? NSString } - + if let buttons = userInfo["buttons"] as? NSArray { buttons.forEach{ guard @@ -66,7 +65,7 @@ public class SwiftMindboxIosPlugin: NSObject, FlutterPlugin { } channel.invokeMethod("pushClicked", arguments: [link, payload]) } - + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { switch call.method { case "getSdkVersion": @@ -175,29 +174,27 @@ public class SwiftMindboxIosPlugin: NSObject, FlutterPlugin { result(FlutterError(code: "-1", message: "error", details: "Wrong argument count or type")) return } - + guard let message = args[0] as? String, let levelIndex = args[1] as? Int else { result(FlutterError(code: "-1", message: "error", details: "Wrong argument type")) return } - let logLevel: LogLevel - + + // `LogLevel` lives in MindboxLogger, which isn't exposed as a product + // in ios-sdk's Package.swift — `import MindboxLogger` fails in SPM mode. + // Seed `level` from the logger's getter so the type is inferred without + // referencing `LogLevel` explicitly. + var level = Mindbox.logger.logLevel switch levelIndex { - case 0: - logLevel = .debug - case 1: - logLevel = .info - case 2: - logLevel = .default - case 3: - logLevel = .error - case 4: - logLevel = .fault - default: - logLevel = .none + case 0: level = .debug + case 1: level = .info + case 2: level = .default + case 3: level = .error + case 4: level = .fault + default: level = .none } - Mindbox.logger.log(level: logLevel, message: message) + Mindbox.logger.log(level: level, message: message) result(0) default: @@ -206,18 +203,18 @@ public class SwiftMindboxIosPlugin: NSObject, FlutterPlugin { } } -extension SwiftMindboxIosPlugin: UNUserNotificationCenterDelegate { +extension MindboxIosPlugin: UNUserNotificationCenterDelegate { public func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { completionHandler() pushClicked(response: response) } } -extension SwiftMindboxIosPlugin: InAppMessagesDelegate { +extension MindboxIosPlugin: InAppMessagesDelegate { public func inAppMessageTapAction(id: String, url: URL?, payload: String) { channel.invokeMethod("onInAppClick", arguments: [id, url?.absoluteString ?? "", payload]) } - + public func inAppMessageDismissed(id: String) { channel.invokeMethod("onInAppDismissed", arguments: id) } diff --git a/mindbox_ios/ios/Classes/inappCallbacks/Callbacks.swift b/mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/inappCallbacks/Callbacks.swift similarity index 100% rename from mindbox_ios/ios/Classes/inappCallbacks/Callbacks.swift rename to mindbox_ios/ios/mindbox_ios/Sources/mindbox_ios/inappCallbacks/Callbacks.swift diff --git a/mindbox_ios/pubspec.yaml b/mindbox_ios/pubspec.yaml index e49c476d..a57d559f 100644 --- a/mindbox_ios/pubspec.yaml +++ b/mindbox_ios/pubspec.yaml @@ -1,11 +1,11 @@ name: mindbox_ios description: The implementation of 'mindbox' plugin for the iOS platform. -version: 2.15.2 +version: 2.15.3 homepage: https://mindbox.cloud/ repository: https://github.com/mindbox-cloud/flutter-sdk/tree/master/mindbox_ios environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" flutter: ">=2.0.0" flutter: @@ -18,7 +18,7 @@ flutter: dependencies: flutter: sdk: flutter - mindbox_platform_interface: ^2.15.2 + mindbox_platform_interface: ^2.15.3 dev_dependencies: flutter_test: diff --git a/mindbox_platform_interface/CHANGELOG.md b/mindbox_platform_interface/CHANGELOG.md index 0b19b145..54ba0c07 100644 --- a/mindbox_platform_interface/CHANGELOG.md +++ b/mindbox_platform_interface/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.15.3 + +* Upgrade native Android SDK dependency to v2.15.3. +* Upgrade native iOS SDK dependency to v2.15.2. + ## 2.15.2 * Upgrade native Android SDK dependency to v2.15.2. diff --git a/mindbox_platform_interface/pubspec.yaml b/mindbox_platform_interface/pubspec.yaml index dfd4b1f3..647b6d39 100644 --- a/mindbox_platform_interface/pubspec.yaml +++ b/mindbox_platform_interface/pubspec.yaml @@ -1,11 +1,11 @@ name: mindbox_platform_interface description: Mindbox platform interface. -version: 2.15.2 +version: 2.15.3 homepage: https://mindbox.cloud/ repository: https://github.com/mindbox-cloud/flutter-sdk/tree/master/mindbox_platform_interface environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" flutter: ">=2.0.0" dependencies: diff --git a/version-update.sh b/version-update.sh index c385af4e..59440eff 100644 --- a/version-update.sh +++ b/version-update.sh @@ -1,3 +1,4 @@ -#!/bin/bash -VERSION=$1 -sed -i -e "s|mindbox: ^[0-9].[0-9].[0-9]|mindbox: ^${VERSION}|" README.md \ No newline at end of file +#!/usr/bin/env bash +set -euo pipefail +VERSION="${1:?usage: version-update.sh <version>}" +sed -i -e "s|mindbox: ^[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}|mindbox: ^${VERSION}|" README.md \ No newline at end of file