SFMCSDK.Net.iOS
5.0.0.1
dotnet add package SFMCSDK.Net.iOS --version 5.0.0.1
NuGet\Install-Package SFMCSDK.Net.iOS -Version 5.0.0.1
<PackageReference Include="SFMCSDK.Net.iOS" Version="5.0.0.1" />
<PackageVersion Include="SFMCSDK.Net.iOS" Version="5.0.0.1" />
<PackageReference Include="SFMCSDK.Net.iOS" />
paket add SFMCSDK.Net.iOS --version 5.0.0.1
#r "nuget: SFMCSDK.Net.iOS, 5.0.0.1"
#:package SFMCSDK.Net.iOS@5.0.0.1
#addin nuget:?package=SFMCSDK.Net.iOS&version=5.0.0.1
#tool nuget:?package=SFMCSDK.Net.iOS&version=5.0.0.1
SFMCSDK.Net.iOS
.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
- What is bound, and how
- Installing
- How this repository works
- Building locally
- Tests
- Upgrading the SFMCSDK
- Releasing
- Troubleshooting
- Licence
Packages
| Package | Wraps | What it is for |
|---|---|---|
SFMCSDK.Net.iOS |
SFMCSDK.xcframework 5.0.0 |
The SFMC SDK core: SFMCSdk.InitializeSdk, identity, custom events, logging, the In-App-Messaging and push-feature event models, and the v5 Inbox models |
Versions are <SFMCSDK version>.<binding revision> — 5.0.0.1 is SFMCSDK 5.0.0, binding revision 1.
SFMCSDK 5 pairs with MobilePush 12. The native core accepts only the module generation it was released with — 5.0.0 reports 12.0.0 - 12.9.9 as its compatible range for the engagement (MobilePush) module, where 4.0.1 reported 11.0.0 - 11.9.9. Use this package with MarketingCloudSDK.Net.iOS 12.x, and stay on 4.0.1.x for as long as you are on MobilePush 11.
What is bound, and how
The whole Objective-C projection of the framework — 188 interfaces, 37 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 and then to 5.0.0 by diffing each pair of 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 5.0.0 header (every type present, every non-unavailable selector bound, no stray selectors, every enum case and raw value equal), and the packed binding passes live smoke tests on a simulator: the native SDK reports its version, initializes and calls back, answers identity, state and module-status reads, and round-trips the new Inbox objects.
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.
What changed at v5: the Inbox feature arrived — SFMCSdkConfigBuilder.SetInboxFeature, the ISFMCSdkInboxMessage family of protocols, the SFMCSdkInbox…Event classes and SFMCSdkModuleName.InboxFeature — along with SFMCSdk.GetStatus (module), SFMCSdkBadgeAggregator and SFMCSdkURLType. One raw value moved: SFMCSdkEventCategory.FlushEvents is 7, not 6. The only members removed are 26 parameterless constructors that could not be called without aborting the process — the behaviours (SFMCSdkAppBackgrounded and its siblings, SFMCSdkScreenEntry), which only the SDK creates, and the cart, order and catalog object events, which are built through the constructor the native class declares, such as new SFMCSdkAddToCartEvent (lineItem). The 5.0.0.1 release note has the full list.
Installing
<PackageReference Include="SFMCSDK.Net.iOS" Version="5.0.0.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 namedSFMCSDKon 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 5.0.0.1 into ./artifacts
dotnet test tests/SFMCSDK.Net.iOS.PackageTests
Tests
dotnet test tests/SFMCSDK.Net.iOS.PackageTests
./.github/scripts/run-simulator-tests.sh 5.0.0.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, module-status and identity reads; the objects new in 5.0.0 and the cart, order and catalog object events are built and read back.
One measured upstream behaviour they encode: with zero modules configured, initializeSdk's completion block fires once per call, a few milliseconds after the call returns, on a background thread, with an empty array — it reports per-module statuses, and there are none. That is the same on 4.0.1 and 5.0.0. Earlier versions of this README said the block never fires; that was a simulator app without keychain access (see Troubleshooting), observed on the net8 and net9 legs and mistaken for SDK behaviour. The first check the tests run now is that the keychain is usable.
Upgrading the SFMCSDK
./build/BumpNativeVersion.sh 5.1.0
then port the SFMCSDK-Swift.h diff into ApiDefinitions.cs and StructsAndEnums.cs by hand — the script prints what it does not automate. Salesforce publishes no release notes and its major tags share no git history, so the shipped framework is the only record of what changed: diff the header, the Info.plist (minimum iOS, slices) and the linked libraries, and read the compatibility ranges out of SFMCSdk.State. 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.
InitializeSdk's completion never fires, and identity edits do nothing, on a simulator. The native SDK keeps its keys in the keychain and does not initialize without it — silently. A simulator app that carries no entitlements is refused the keychain (errSecMissingEntitlement, -34018), and that is how the .NET 8 and .NET 9 iOS workloads build one; the .NET 10 workload embeds simulated entitlements by itself, so the same app works there. Give the app an Entitlements.plist with a keychain-access-groups entry — the sample and the device tests in this repository show a simulator-only variant, with CodesignRequireProvisioningProfile off so that no provisioning profile is needed. A device build is signed with a profile and is not affected.
A module stays inactive after upgrading to 5.x. SFMCSDK 5.0.0 only accepts MobilePush 12.x (see Packages); SFMCSdk.State prints the range each module must fall in.
A net8 app using Shell hangs at launch on iOS 26.0. The app shows a black screen at 100% CPU. It's a bug in Microsoft.Maui.Controls, seen in apps built with Xcode 26 and fixed in 9.0.110 by dotnet/maui#31149. This package can't work around it, and 8.0.100, the last 8.0.x, doesn't have the fix. iOS 26.5 and 27.0 aren't affected. On net9, use Controls 9.0.110 or newer. On net8, subclass ShellItemRenderer and override TabBarHidden to forward only real changes, returning the subclass from ShellRenderer.CreateShellItemRenderer. Setting UIDesignRequiresCompatibility to true in Info.plist also works, but it changes the look of the whole app.
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 5.0.0 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 | Versions 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. |
-
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 |
|---|---|---|
| 5.0.0.1 | 67 | 11/27/2026 |
| 5.0.0.1-beta.14.18 | 43 | 11/28/2026 |
| 5.0.0.1-beta.13.17 | 63 | 11/17/2026 |
| 5.0.0.1-beta.13.16 | 66 | 11/17/2026 |
| 5.0.0.1-beta.13.15 | 63 | 11/17/2026 |
| 4.0.1.2 | 553 | 7/30/2026 |
| 4.0.1.2-beta.12.14 | 66 | 10/31/2026 |
| 4.0.1.2-beta.11.13 | 80 | 10/31/2026 |
| 4.0.1.2-beta.9.12 | 72 | 10/30/2026 |
| 4.0.1.2-beta.8.10 | 98 | 7/30/2026 |
| 4.0.1.2-beta.7.11 | 94 | 7/30/2026 |
| 4.0.1.2-beta.6.7 | 104 | 7/30/2026 |
| 4.0.1.1 | 169 | 7/30/2026 |
| 4.0.1.1-beta.3.4 | 104 | 7/30/2026 |
| 1.1.3.8 | 9,911 | 10/30/2024 |
| 1.1.3.6 | 245 | 10/7/2024 |
| 1.1.2.10 | 763 | 7/12/2024 |
| 1.1.2.9 | 219 | 7/12/2024 |
| 1.1.2.4 | 231 | 7/12/2024 |
| 1.1.2.3 | 332 | 5/20/2024 |
## What's changed
Binds **SFMCSDK 5.0.0** (was 4.0.1), a major release of the native core. It brings the Inbox
feature and pairs with **MobilePush 12**. Target frameworks (`net8.0-ios18.0`, `net9.0-ios18.0`,
`net10.0-ios26.0`) and the iOS floor (12.2) are unchanged. No .NET member was renamed, and the
only members removed are 26 parameterless constructors that could not be called without
aborting the process.
Salesforce published no release notes for 5.0.0, and its v4 and v5 tags share no git history, so
everything below comes from the shipped framework: the `SFMCSDK-Swift.h` diff, ported by hand
and checked selector by selector in both directions, the framework's `Info.plist` and linked
libraries, and what the SDK does on a simulator.
## Breaking changes
- **Needs MobilePush 12.** The core accepts only the module generation it shipped with:
`SFMCSdk.State` on 5.0.0 gives `12.0.0 - 12.9.9` as the range for the engagement (MobilePush)
module, where 4.0.1 gave `11.0.0 - 11.9.9`. Native MobilePush 12.0.0 in turn requires
SFMCSDK 5.0.0 or newer. Use this package with
[MarketingCloudSDK.Net.iOS](https://github.com/sbokatuk/MarketingCloudSDK.Net.iOS) 12.x, and
stay on [4.0.1.2](https://github.com/sbokatuk/SFMCSDK.Net.iOS/releases/tag/v4.0.1.2) while you
are on MobilePush 11. The other ranges moved too: push feature 3.x (was 2.x), in-app messaging
feature 2.x (was 1.x), mobile app messaging 3.x (was 2.x); the new inbox feature is 1.x.
- **`SFMCSdkEventCategory.FlushEvents` is 7, not 6.** The new `InboxFeature` case took 6. Code
compiled against 4.0.1.x has the old constant baked in, so recompile; and don't compare the
category against a number you stored earlier.
- **`ISFMCSdkInAppMessageDetails` has two more required members**, `MinTimeBetweenDisplay` and
`CustomKeys`. Reading them from the messages the SDK hands you needs no change. A class of
your own that implements the interface, or derives from `SFMCSdkInAppMessageDetails`, has to
add them.
- **Four enums gained cases**, so a `switch` that lists every case needs a new arm:
`SFMCSdkModuleName.InboxFeature`, `SFMCSdkMessageProducer.InboxFeature`,
`SFMCSdkEventCategory.InboxFeature` and `SFMCSdkBehaviorType.AppWillResignActive`.
- **26 parameterless constructors are removed.** The native header marks `init` and `new`
unavailable on `SFMCSdkBehavior` and `SFMCSdkEngagementEvent`, none of the classes below
declares an `init` of its own, and the `-init` they inherit ends in
`swift_stdlib_reportUnimplementedInitializer`, which aborts the process. That is true of 4.0.1
as well as 5.0.0. The binding generated a public `new X ()` for each anyway, and calling it
could only crash. Code that called one now fails to compile instead of at run time; code that
runs today is not affected.
- **The 17 cart, order and catalog object events** keep their real constructor, the one the
native class declares, which was bound all along:
`new SFMCSdkAddToCartEvent (lineItem)` and `new SFMCSdkRemoveFromCartEvent (lineItem)`;
`new SFMCSdkReplaceCartEvent (lineItems)`;
`new SFMCSdkPurchaseOrderEvent (order)` and likewise `SFMCSdkPreorderEvent`,
`SFMCSdkCancelOrderEvent`, `SFMCSdkShipOrderEvent`, `SFMCSdkDeliverOrderEvent`,
`SFMCSdkReturnOrderEvent` and `SFMCSdkExchangeOrderEvent`;
`new SFMCSdkViewCatalogObjectEvent (catalogObject)` and likewise
`SFMCSdkViewCatalogObjectDetailEvent`, `SFMCSdkQuickViewCatalogObjectEvent`,
`SFMCSdkFavoriteCatalogObjectEvent`, `SFMCSdkShareCatalogObjectEvent`,
`SFMCSdkReviewCatalogObjectEvent` and `SFMCSdkCommentCatalogObjectEvent`.
- **Their three base classes**, `SFMCSdkCartEvent`, `SFMCSdkOrderEvent` and
`SFMCSdkCatalogObjectEvent`, declare no initializer at all: build one of the events above.
- **Six behaviours**, `SFMCSdkAppBackgrounded`, `SFMCSdkAppBecameActive`,
`SFMCSdkAppForegrounded`, `SFMCSdkAppTerminated`, `SFMCSdkAppVersionChanged` and
`SFMCSdkScreenEntry`, are created by the SDK for its own behaviour observers. The native
Objective-C surface has no call that registers an observer, so .NET code neither constructs
nor receives them today. There is nothing to construct, and there never was.
A class of your own that derives from one of the events has to call the real base
constructor, for example `: base (lineItem)`.
Apps that take the core through the [SFMCSDK.Net](https://github.com/sbokatuk/SFMCSDK.Net)
umbrella cannot move to this package until the umbrella re-pins, because the published
SFMCSDK.Net 4.0.1.2 depends on `SFMCSDK.Net.iOS` at exactly `[4.0.1.2]`.
## New API
- **Inbox.** `SFMCSdkConfigBuilder.SetInboxFeature`; the message model as protocols
(`ISFMCSdkInboxMessage`, `ISFMCSdkInboxText`, `ISFMCSdkInboxMedia`, `ISFMCSdkInboxButton`,
`ISFMCSdkInboxAction`); `SFMCSdkInboxMessageInteraction`; the string constants in
`SFMCSdkInboxActionType`, `SFMCSdkInboxAudienceType` and `SFMCSdkInboxMediaType`; the event
classes under `SFMCSdkInboxEvent` and `SFMCSdkInboxPrivacyStatusChangeEvent`; and
`InboxFeatureProtocol` for module authors. The Inbox feature itself is a separate native
module (`InboxFeatureSDK`) with no .NET binding yet; this package carries the models and
events the core shares with it.
- `SFMCSdk.GetStatus (SFMCSdkModuleName)` returns one module's status at any time.
- `SFMCSdkURLType` names the `type` strings passed to `ISFMCSdkURLHandlingDelegate.HandleURL`.
- `SFMCSdkBadgeAggregator`, `SFMCSdkAppWillResignActive`, and `SFMCSdk.SetHostRuntime`, which
upstream reserves for its own hybrid wrappers.
- `SFMCSdkInAppMessageCloseAction` can now be constructed and read (`DismissReason`, `Id`);
`SFMCSdkPrivacyStatusChangeEvent` exposes `IsBlocked` and `ShouldDeleteData`;
`SFMCSdkInAppPrivacyStatusChangeEvent` exposes `Source`.
- New enums: `SFMCSdkAppState`, `SFMCSdkBadgeChannel`, `SFMCInboxAnalyticsType`,
`SFMCSdkInboxMessageType`, `SFMCSdkInboxInteractionType`, `SFMCSdkInboxDataFailedReason`,
`SFMCSdkInboxDataRequestTrigger`, `SFMCWrapperName`.
## Behaviour, measured
- **`InitializeSdk`'s completion fires with zero modules.** It is called once per call to
`InitializeSdk`, a few milliseconds after that call returns, on a background thread, with an
empty array. The same app, built against the published 4.0.1.2, shows that 4.0.1 does the
same. The README and the device tests used to say the block never fires in this case. That
was wrong, and so was putting it down to the SDK: see the next point.
- **Without keychain access the SDK does not initialize, and says nothing.** No completion
block, no identity edits, while `SFMCSdk.State` still answers. On a simulator, an app with no
entitlements is refused the keychain (`errSecMissingEntitlement`, -34018), and the .NET 8 and
.NET 9 iOS workloads build simulator apps that way; the .NET 10 workload embeds simulated
entitlements by itself. So the same code initialized on `net10.0-ios26.0` and silently did not
on `net8.0-ios18.0` and `net9.0-ios18.0`. Give a simulator build an `Entitlements.plist` with
a `keychain-access-groups` entry; the
[README](https://github.com/sbokatuk/SFMCSDK.Net.iOS#troubleshooting) has the details and the
[sample](https://github.com/sbokatuk/SFMCSDK.Net.iOS/tree/main/samples/SFMCSDK.Net.iOS.Example)
shows it. A device build is signed with a provisioning profile and is not affected. This is
not new in 5.0.0, only newly understood.
- On an initialized SDK, `SFMCSdk.Identity.Edit` runs its updater before it returns.
## Native framework
- Slices are unchanged (`ios-arm64`, `ios-arm64_x86_64-simulator`), and so is the minimum iOS
version (12.0 in the framework; this package keeps its 12.2 floor).
- Built by Salesforce against the iOS 26.5 SDK with Swift 6.3.3 (4.0.1: iOS 26.2 SDK, Swift
6.2.3). The binary now also weak-links `libswiftSpatial` and `libswiftsimd`; both come from
the system and need nothing from an app. The frameworks it links are the same.
## Tested
On an iPhone 17 Pro simulator (iOS 26.5), with Xcode 26.0.1:
- the package tests, on the packed `.nupkg`;
- the simulator smoke tests on `net8.0-ios18.0`, `net9.0-ios18.0` and `net10.0-ios26.0`: the SDK
reports 5.0.0, the keychain is usable, initialization completes with no module statuses, every
module reports inactive, `Identity.Edit` runs its updater, a native `FlushEvent` and a native
Inbox event report categories 7 and 6, the new Inbox, privacy and close-action objects are
built and read back, and each of the 17 cart, order and catalog object events is built through
its constructor and read back;
- the sample app on `net10.0-ios26.0` and `net9.0-ios18.0`: initialization, a profile id, a
custom event.
Not tested here: a real device; MobilePush 11 or 12 loaded against this core (the pairing above
is read from `SFMCSdk.State` and from upstream's `Package.swift`, not from a run); and the Inbox
feature with its own module and a tenant.