SFMCSDK.Net.iOS 4.0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package SFMCSDK.Net.iOS --version 4.0.1.1
                    
NuGet\Install-Package SFMCSDK.Net.iOS -Version 4.0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SFMCSDK.Net.iOS" Version="4.0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SFMCSDK.Net.iOS" Version="4.0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="SFMCSDK.Net.iOS" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SFMCSDK.Net.iOS --version 4.0.1.1
                    
#r "nuget: SFMCSDK.Net.iOS, 4.0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SFMCSDK.Net.iOS@4.0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SFMCSDK.Net.iOS&version=4.0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=SFMCSDK.Net.iOS&version=4.0.1.1
                    
Install as a Cake Tool

SFMCSDK.Net.iOS

NuGet release Targets: net8.0 | net9.0 | net10.0 SFMCSDK 4.0.1 Licence: MIT AND BSD-3-Clause

.NET for iOS bindings for the Salesforce Marketing Cloud SFMCSDK core framework — identity, event tracking, logging, and the module plumbing the MobilePush module plugs into.

dotnet add package SFMCSDK.Net.iOS
using SFMCSDK;

var config = new SFMCSdkConfigBuilder().Build();
SFMCSdk.InitializeSdk(config, statuses => { });

SFMCSdk.Identity.Edit(modifier =>
{
    modifier.ProfileId = "contact-key";
    return modifier;
});

Push notifications live in the sibling MarketingCloudSDK.Net.iOS, which depends on this package the same way the native MobilePush package depends on SFMCSDK. A cross-platform ergonomic layer lives in SFMCSDK.Net.


Contents

Packages

Package Wraps What it is for
SFMCSDK.Net.iOS SFMCSDK.xcframework 4.0.1 The SFMC SDK core: SFMCSdk.InitializeSdk, identity, custom events, logging, the v4 In-App-Messaging and push-feature event models

Versions are <SFMCSDK version>.<binding revision>4.0.1.1 is SFMCSDK 4.0.1, binding revision 1.

What is bound, and how

The whole Objective-C projection of the framework — 156 interfaces, 29 enums — in namespace SFMCSDK, the same namespace the old sfmc-net-bindings-mobile packages exposed.

By hand, never by Sharpie. ApiDefinitions.cs descends from the hand-curated 1.x binding, ported to 4.0.1 by diffing the two versions' SFMCSDK-Swift.h and applying the changes — Objective Sharpie cannot parse recent iOS SDK module maps, and regenerating would lose every hand-applied fix. The port was verified selector-by-selector against the 4.0.1 header (every type present, every non-unavailable selector bound, no stray selectors), and the packed binding passes live smoke tests on a simulator: the native SDK reports its version, initializes, and answers identity and state reads.

What changed at v4, for consumers of the old 1.x packages: the identity class is SFIdentity (edits through Identity.Edit(modifier => …)), SFMCSdkPUSH/PushInterface are gone (push is the sibling package's MarketingCloudSdk), the config builder grew per-module setters (SetPushFeature, SetEngagement, SetPersonalization, SetMAM, SetInAppMessagingFeature, SetCdp), InitializeSdk gained a per-module completion block, and large In-App-Messaging, Personalization and push-feature event surfaces are new.

Installing

<PackageReference Include="SFMCSDK.Net.iOS" Version="4.0.1.1" />

Target frameworks: net8.0-ios18.0, net9.0-ios18.0, net10.0-ios26.0. Floor: iOS 12.2 (the framework is Swift and relies on the OS Swift runtime, ABI-stable from 12.2 — Salesforce's own podspec says 12.0, which predates that line).

How this repository works

Nothing native is committed. Salesforce commits the built xcframework into the sfmc-sdk-ios repository tree and attaches nothing to its releases, so build/FetchXcFrameworks.sh downloads the tag's source archive and verifies every slice binary against the SHA-256 pins in build/checksums.txt — pins are over the binaries, not the archive, because GitHub generates tag archives on the fly and has changed their bytes before.

Each .NET SDK's iOS workload builds two target frameworks, so build/BuildNugets.sh packs twice (net9 band, then net10 from a scratch global.json) and build/merge-packages.py grafts the net10 assets into one package. The native payload ships as one compressed .resources.zip (NU5123 and Windows MAX_PATH otherwise).

CocoaPods trap. The pod for this framework is MarketingCloud-SFMCSdk. The pod literally named SFMCSDK on CocoaPods is an unrelated squatter package — never resolve by that name.

Layout

Path What
src/Sfmc.Binding.props TFM bands, xcframework validation, packaging — kept a one-file port from the sibling MarketingCloudSDK.Net.iOS
src/SFMCSDK.Net.iOS/ ApiDefinitions.cs + StructsAndEnums.cs, hand-maintained
build/ Fetch, checksum, pack and upgrade scripts; packages.tsv is the roster
tests/ PackageTests (nupkg shape, no workloads needed) and DeviceTests (a bare UIKit app driving the real SDK on a simulator)
samples/ A MAUI app driving initialization, identity and events
.github/workflows/ pr, release, auto-release, upstream-drift

Building locally

./build/FetchXcFrameworks.sh          # populate ./libs, checksum-verified
./build/BuildNugets.sh                # packs 4.0.1.1 into ./artifacts
dotnet test tests/SFMCSDK.Net.iOS.PackageTests

Tests

dotnet test tests/SFMCSDK.Net.iOS.PackageTests
./.github/scripts/run-simulator-tests.sh 4.0.1.1 net9.0-ios18.0

The simulator tests run without credentials on purpose: the native SDK loads, reports its version, initializes standalone and answers state and identity reads. One verified upstream behaviour they encode: with zero modules configured, initializeSdk's completion block never fires — it reports per-module statuses, and there are none.

Upgrading the SFMCSDK

./build/BumpNativeVersion.sh 4.1.0

then port the SFMCSDK-Swift.h diff into ApiDefinitions.cs by hand — the script prints what it does not automate. The upstream-drift workflow files an issue when Salesforce tags a version this repository does not bind.

Releasing

Merging a file named docs/release-notes/<four-part-version>.md to main is the release: auto-release tags it, release packs with verification off and publishes to nuget.org via trusted publishing (OIDC — no stored API key). Every PR publishes a -beta.<pr>.<run> prerelease.

Troubleshooting

SFMCSDK.xcframework is missing. Run ./build/FetchXcFrameworks.sh — nothing native is committed, and packing does not fetch.

Xcode version errors building the net10 sample locally. The net10 iOS workload pins an exact Xcode line (CI selects Xcode_26.0); with a newer local Xcode, build the net9-band device tests instead — they exercise the same packed package.

A selector you need is missing. The binding covers the whole 4.0.1 ObjC projection; if Salesforce adds surface in a newer tag, upstream-drift will have filed an issue — port the header diff or file an issue.

Licence

The binding code in this repository is MIT. The native SFMCSDK framework inside the package is © Salesforce, BSD-3-Clause. The package licence expression is MIT AND BSD-3-Clause and both texts ship in every package under licenses/.

Product Compatible and additional computed target framework versions.
.NET net8.0-ios18.0 is compatible.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net10.0-ios was computed.  net10.0-ios26.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-ios26.0

    • No dependencies.
  • net8.0-ios18.0

    • No dependencies.
  • net9.0-ios18.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SFMCSDK.Net.iOS:

Package Downloads
MarketingCloudSDK.Net.iOS

.NET for iOS bindings for the Salesforce Marketing Cloud MobilePush framework (MarketingCloudSDK) - push registration, inbox, in-app messages and location messaging - at the v11 Unified SDK generation. Successor to the sfmc-net-bindings-mobile packages.

SFMCSDK.Net

One cross-platform API for the Salesforce Marketing Cloud SFMC SDK core: awaitable initialization, identity (contact key and attributes) and custom event tracking on Android and iOS from shared code, over the SFMCSDK.Net.Android and SFMCSDK.Net.iOS bindings. Restores on plain target frameworks too, so shared class libraries and unit tests need no platform conditionals.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1.2 260 7/30/2026
4.0.1.2-beta.8.10 54 7/30/2026
4.0.1.2-beta.7.11 54 7/30/2026
4.0.1.2-beta.6.7 59 7/30/2026
4.0.1.1 125 7/30/2026
4.0.1.1-beta.3.4 54 7/30/2026
1.1.3.8 8,987 10/30/2024
1.1.3.6 211 10/7/2024
1.1.2.10 740 7/12/2024
1.1.2.9 193 7/12/2024
1.1.2.4 202 7/12/2024
1.1.2.3 305 5/20/2024
1.1.2.2 216 5/17/2024
1.1.1.81 483 2/28/2024
1.1.1.80 227 2/28/2024
1.1.1.79 251 2/22/2024
1.1.1.71 229 2/7/2024
1.1.1.2 218 2/12/2024

## What's changed

First release of the rebuilt binding, at the Unified SDK generation.

- Binds **SFMCSDK 4.0.1** (was 1.x in the retired `sfmc-net-bindings-mobile` packages), fetched
 from the `sfmc-sdk-ios` tag archive with every slice binary SHA-256-pinned.
- The hand-curated `ApiDefinitions.cs` was ported 1.1.x → 4.0.1 by header diff and verified
 selector-by-selector against the 4.0.1 `SFMCSDK-Swift.h`; the packed binding passes live
 simulator smoke tests (version read, standalone initialization, state and identity).
- Target frameworks `net8.0-ios18.0`, `net9.0-ios18.0`, `net10.0-ios26.0` — real
 multi-targeting; the old net7-era `sed`-the-TFM packaging is gone, and the native payload now
 ships as one compressed `.resources.zip`.
- Migrating from `1.x`: identity is now `SFIdentity` edited through
 `SFMCSdk.Identity.Edit(modifier => …)`; `SFMCSdkPUSH`/`PushInterface` moved to the sibling
 MarketingCloudSDK.Net.iOS package; the config builder gained per-module setters and
 `InitializeSdk` a per-module completion block; the namespace `SFMCSDK` is unchanged.