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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
name: Build iOS flutter app (CocoaPods)
runs-on: macos-15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

Check warning on line 14 in .github/workflows/build-ios.yml

View workflow job for this annotation

GitHub Actions / Scan GitHub Actions workflows

artipacked

build-ios.yml:14: credential persistence through GitHub Actions artifacts: does not set persist-credentials: false
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
with:
Expand Down Expand Up @@ -79,7 +79,11 @@
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
# mParticle-Apple-SDK's podspec declares iOS 15.0 but re-exports RoktContracts, which requires 15.6.
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.6'
# Keep in sync with the README's CocoaPods snippet: raise lower targets only.
current = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_s
if current.match?(/\A\d+(\.\d+)*\z/) && Gem::Version.new(current) < Gem::Version.new('15.6')
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.6'
end
end
end
end
Expand Down Expand Up @@ -108,7 +112,7 @@
steps:
# The default checkout folder, mparticle-flutter-sdk, differs from the Dart package name on
# purpose: the example must build from a normal clone (https://github.com/flutter/flutter/issues/186881).
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

Check warning on line 115 in .github/workflows/build-ios.yml

View workflow job for this annotation

GitHub Actions / Scan GitHub Actions workflows

artipacked

build-ios.yml:115: credential persistence through GitHub Actions artifacts: does not set persist-credentials: false
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
with:
Expand Down
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ To install mParticle on an Android platform:

```groovy
dependencies {
implementation 'com.mparticle:android-core:6.0.0'
implementation 'com.mparticle:android-core:6.1.9'

// Required if you use Rokt APIs or RoktLayout from Flutter.
// RoktEmbeddedView and related types live in android-rokt-kit, not android-core.
implementation 'com.mparticle:android-rokt-kit:6.0.0'
implementation 'com.mparticle:android-rokt-kit:6.1.9'

// Required for gathering Android Advertising ID (see below)
implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
Expand Down Expand Up @@ -162,7 +162,7 @@ Flutter versions before 3.41 can't build the plugin with Swift Package Manager.

#### CocoaPods (deprecated)

CocoaPods trunk becomes read-only on 2 December 2026, so no new mParticle or Rokt pod versions can be published after that date. If Swift Package Manager is turned off for your app, add the kits to `ios/Podfile`:
CocoaPods trunk becomes read-only on 2 December 2026, so no new mParticle or Rokt pod versions can be published after that date. If Swift Package Manager is turned off for your app, add the kits to `ios/Podfile` and raise any pod's deployment target below 15.6 to 15.6. A Podfile can have only one `post_install` block, so replace the one Flutter generated with this one:

```ruby
platform :ios, '15.6'
Expand All @@ -175,6 +175,20 @@ target 'Runner' do

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
# The mParticle-Apple-SDK pod declares iOS 15.0 but depends on RoktContracts, which requires 15.6.
# Raise lower targets only; pods that need a later iOS keep their own.
current = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_s
if current.match?(/\A\d+(\.\d+)*\z/) && Gem::Version.new(current) < Gem::Version.new('15.6')
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.6'
end
end
end
end
```

Then run `pod install`.
Expand All @@ -183,6 +197,7 @@ Then run `pod install`.

- `Rokt is unavailable. Add the mParticle Rokt kit (mParticle-Rokt) to your iOS app.`: the Rokt kit isn't linked into the app. Add it as shown above.
- `[mParticle] The mParticle SDK is loaded more than once`: the SDK comes from both CocoaPods and Swift Package Manager. Remove the mParticle and Rokt pods from `ios/Podfile`.
- `Compiling for iOS 15.0, but module 'RoktContracts' has a minimum deployment target of iOS 15.6` with CocoaPods: raise the pods' deployment target to 15.6 in the `post_install` block, as shown above.
- Package resolution fails, for example `no versions of '…' match the requirement`, or the build uses an old minimum iOS version: run `flutter clean`, then in Xcode choose **File > Packages > Reset Package Caches**.

The mParticle SDK is initialized by calling the `startWithOptions` method within the `application:didFinishLaunchingWithOptions:` delegate call. Preferably the location of the initialization method call should be one of the last statements in the `application:didFinishLaunchingWithOptions:`. The `startWithOptions` method requires an options argument containing your key and secret and an initial Identity request.
Expand Down
Loading